Skip to content

Commit

Permalink
fix: now detects teacher accounts and reports to the user that it's n…
Browse files Browse the repository at this point in the history
…ot supported yet
  • Loading branch information
Truiteseche committed Oct 16, 2024
1 parent 219bfb4 commit 1a4720f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function consoleLogEDPLogo() {
consoleLogEDPLogo();

const currentEDPVersion = "0.4.0";
const apiVersion = "4.60.5";
const apiVersion = "4.64.0";

// secret webhooks
const carpeConviviale = "CARPE_CONVIVIALE_WEBHOOK_URL";
Expand Down Expand Up @@ -1355,7 +1355,12 @@ export default function App({ edpFetch }) {
}
let token = response.token // collecte du token
let accountsList = [];
let accounts = response.data.accounts[0];
let accounts = response.data.accounts.find((account) => account.typeCompte !== "P") ?? response.data.accounts[0];
if (response.data.accounts.some((account) => account.typeCompte === "P")) {
messages.submitButtonText = "Échec de la connexion";
messages.submitErrorMessage = "Les comptes enseignants ne sont pas supportés par Ecole Directe Plus";
return;
}
const accountType = accounts.typeCompte; // collecte du type de compte
if (accountType === "E") {
// compte élève
Expand Down

0 comments on commit 1a4720f

Please sign in to comment.