Merge branch 'staging' into dev

This commit is contained in:
Maxime Lalo 2023-09-21 12:26:13 +02:00
commit b1cd16e154

View File

@ -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 decodedToken = (await token.json()) as IIdNotToken;
console.log(decodedToken);
const decodedIdToken = jwt.decode(decodedToken.id_token) as IdNotJwtPayload;
return decodedIdToken;
}