using IDNOT_REDIRECT_URL instead of APP_HOST
This commit is contained in:
parent
a3e88cdbd2
commit
7c07b5674d
@ -22,7 +22,7 @@ export default class UserController extends ApiController {
|
||||
protected async getUserInfosFromIdnot(req: Request, response: Response) {
|
||||
try {
|
||||
const code = req.params["code"];
|
||||
if (!code) throw new Error("code is required");
|
||||
if (!code) throw new Error("code is required");
|
||||
|
||||
const idNotToken = await this.idNotService.getIdNotToken(code);
|
||||
if(!idNotToken) {
|
||||
|
@ -117,11 +117,14 @@ export default class IdNotService extends BaseService {
|
||||
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.IDNOT_REDIRECT_URL,
|
||||
code: code,
|
||||
grant_type: "authorization_code",
|
||||
});
|
||||
});
|
||||
|
||||
const token = await fetch(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query, { method: "POST" });
|
||||
if(token.status !== 200) console.error(await token.text());
|
||||
|
||||
const decodedToken = (await token.json()) as IIdNotToken;
|
||||
const decodedIdToken = jwt.decode(decodedToken.id_token) as IdNotJwtPayload;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user