From f06539bb787644908a527bdcae5268943d9e054d Mon Sep 17 00:00:00 2001 From: OxSaitama Date: Wed, 4 Oct 2023 19:28:07 +0200 Subject: [PATCH] refacto votes and connexion --- package.json | 2 +- src/front/Api/Auth/IdNot/User.ts | 1 - src/front/Api/Auth/IdNot/index.ts | 1 - .../Components/DesignSystem/DepositOtherDocument/index.tsx | 5 ----- src/front/Components/Layouts/LoginCallback/index.tsx | 1 + .../Components/Layouts/Users/UserInformations/index.tsx | 2 +- 6 files changed, 3 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 7d306a4d..9d3fba5b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "eslint-config-next": "13.2.4", "form-data": "^4.0.0", "jwt-decode": "^3.1.2", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.89", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.90", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", diff --git a/src/front/Api/Auth/IdNot/User.ts b/src/front/Api/Auth/IdNot/User.ts index 96c54a77..1854979a 100644 --- a/src/front/Api/Auth/IdNot/User.ts +++ b/src/front/Api/Auth/IdNot/User.ts @@ -27,7 +27,6 @@ export default class User extends BaseApiService { } public async verifyJwt(jwt: string) { - console.log(this.baseURl); const url = new URL(`${this.baseURl}/verify-token/${jwt}`); try { return await this.postRequest(url); diff --git a/src/front/Api/Auth/IdNot/index.ts b/src/front/Api/Auth/IdNot/index.ts index 58cd9933..b358b6c8 100644 --- a/src/front/Api/Auth/IdNot/index.ts +++ b/src/front/Api/Auth/IdNot/index.ts @@ -16,7 +16,6 @@ export default class Auth extends BaseApiService { public async logOutWithIdNot() { const variables = FrontendVariables.getInstance(); const url = new URL(`${variables.IDNOT_BASE_URL}/user/auth/logout?post_logout_redirect_uri=${variables.FRONT_APP_HOST}`); - console.log(url.toString()) try { return await fetch(url); } catch (err) { diff --git a/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx b/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx index 7d84c26b..d2192944 100644 --- a/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositOtherDocument/index.tsx @@ -121,7 +121,6 @@ export default class DepositOtherDocument extends React.Component 0 && (
{this.state.currentFiles.map((file) => { - console.log(file); const fileObj = file.file; @@ -237,9 +236,6 @@ export default class DepositOtherDocument extends React.Component file.index === parseInt(indexToRemove)); diff --git a/src/front/Components/Layouts/LoginCallback/index.tsx b/src/front/Components/Layouts/LoginCallback/index.tsx index 12d2293c..86b3a6e2 100644 --- a/src/front/Components/Layouts/LoginCallback/index.tsx +++ b/src/front/Components/Layouts/LoginCallback/index.tsx @@ -22,6 +22,7 @@ export default function LoginCallBack() { if (!code) return; try { const token = await Auth.getInstance().getIdnotJwt(code as string); + if (!token) return router.push(Module.getInstance().get().modules.pages.Login.props.path); await UserStore.instance.connect(token.accessToken, token.refreshToken); return router.push(Module.getInstance().get().modules.pages.Folder.props.path); } catch (e) { diff --git a/src/front/Components/Layouts/Users/UserInformations/index.tsx b/src/front/Components/Layouts/Users/UserInformations/index.tsx index 9962f139..9f393bd0 100644 --- a/src/front/Components/Layouts/Users/UserInformations/index.tsx +++ b/src/front/Components/Layouts/Users/UserInformations/index.tsx @@ -165,7 +165,7 @@ export default function UserInformations(props: IProps) { let vote = Vote.hydrate({ appointment: Appointment.hydrate({ uid: currentAppointment?.uid ?? undefined, - targeted_user: User.hydrate({ + user: User.hydrate({ uid: userSelected.uid, }), choice: superAdminModalType === "add" ? EVote.NOMINATE : EVote.DISMISS,