finished login

This commit is contained in:
Vins 2023-09-21 11:52:12 +02:00
parent 94563aff57
commit 8c60976754

View File

@ -107,13 +107,6 @@ export default class IdNotService extends BaseService {
} }
public async getIdNotToken(code: string) { public async getIdNotToken(code: string) {
console.log(code);
console.log(this.variables.APP_HOST);
const test = this.variables.APP_HOST + "/authorized-client"
console.log(test);
const query = new URLSearchParams({ const query = new URLSearchParams({
client_id: this.variables.IDNOT_CLIENT_ID, client_id: this.variables.IDNOT_CLIENT_ID,
client_secret: this.variables.IDNOT_CLIENT_SECRET, client_secret: this.variables.IDNOT_CLIENT_SECRET,
@ -121,14 +114,10 @@ export default class IdNotService extends BaseService {
code: code, code: code,
grant_type: "authorization_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; const decodedToken = (await token.json()) as IIdNotToken;
console.log(decodedToken);
const decodedIdToken = jwt.decode(decodedToken.id_token) as IdNotJwtPayload; const decodedIdToken = jwt.decode(decodedToken.id_token) as IdNotJwtPayload;
console.log(decodedIdToken);
return decodedIdToken; return decodedIdToken;
} }