diff --git a/CHANGELOG.md b/CHANGELOG.md index 7428975..adb3c90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ - **0.2.0**: Réécriture en **typescript** - **1.0.0**: Quand le module sera stable +## 0.2.6 + +- Ajout de la propriété `_accessToken` dans le fichier Session + ## 0.2.5 - Ajout de la fonction `getFileBase64()` pour récupérer un fichier en base64 diff --git a/CITATION.cff b/CITATION.cff index c0deee2..3140391 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -19,5 +19,5 @@ keywords: - ecoledirecte - papillon license: GPL-3.0 -version: 0.2.5 -date-released: '2024-03-10' +version: 0.2.6 +date-released: '2024-03-15' diff --git a/package.json b/package.json index 988afdf..8bd90fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@papillonapp/ed-core", - "version": "0.2.5", + "version": "0.2.6", "description": "API EcoleDirecte pour PapillonApp (c)", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/auth.ts b/src/auth.ts index c0f1611..51b83ac 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -49,6 +49,8 @@ class Auth { const account = data.accounts[0]; + this.session._accessToken = account.accessToken; + this.session.modules = account.modules; this.session.settings = account.parametresIndividuels; this.session.school = this.#getEtabInfo(account); diff --git a/src/session.ts b/src/session.ts index 20f3c19..b0daf44 100644 --- a/src/session.ts +++ b/src/session.ts @@ -26,6 +26,7 @@ import {GetDownloads} from "~/fetch/getDownloads"; class Session { _token: undefined | string; + _accessToken: undefined | string; isLoggedIn: boolean; settings?: accountParameters; student: account | BlankAccount; @@ -54,6 +55,7 @@ class Session { constructor() { this._token = undefined; // Le token + this._accessToken = undefined; this.isLoggedIn = false; this.student = { id: 0 }; // Utilisateur initialisé vide