diff --git a/src/services/common/IdNotService/IdNotService.ts b/src/services/common/IdNotService/IdNotService.ts index 5c31a250..a2100fed 100644 --- a/src/services/common/IdNotService/IdNotService.ts +++ b/src/services/common/IdNotService/IdNotService.ts @@ -107,23 +107,18 @@ export default class IdNotService extends BaseService { } public async getIdNotToken(code: string) { - const redirect_uri: string = `${this.variables.APP_HOST}/authorized-client`; - console.log(redirect_uri); - const query = new URLSearchParams({ client_id: this.variables.IDNOT_CLIENT_ID, client_secret: this.variables.IDNOT_CLIENT_SECRET, - redirect_uri: this.variables.APP_HOST + "/authorized-client", + redirect_uri: `${this.variables.APP_HOST}/authorized-client`, code: code, grant_type: "authorization_code", }); - console.log(query); - const token = await fetch(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query, { method: "POST" }); + const token = await fetch(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query, { method: "POST" }); const decodedToken = (await token.json()) as IIdNotToken; - console.log(decodedToken); - const decodedIdToken = jwt.decode(decodedToken.id_token) as IdNotJwtPayload; + return decodedIdToken; }