mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-19 06:39:08 +00:00
FIX: removed state
This commit is contained in:
@@ -371,13 +371,14 @@ export class AuthController {
|
|||||||
const { authInfo } = req;
|
const { authInfo } = req;
|
||||||
const url = this.frontendRedirectUrl;
|
const url = this.frontendRedirectUrl;
|
||||||
let email, token, refreshToken, error_title, error_description;
|
let email, token, refreshToken, error_title, error_description;
|
||||||
let language: 'pt-br' | 'en-us' = 'pt-br';
|
const language: 'pt-br' | 'en-us' = 'pt-br';
|
||||||
|
// let stateObject;
|
||||||
const stateObject = jwt.verify(
|
// try {
|
||||||
state as string,
|
// stateObject = jwt.verify(state as string, process.env.JWT_PRIVATE_KEY);
|
||||||
process.env.JWT_PRIVATE_KEY,
|
// } catch (error) {
|
||||||
);
|
// console.log('error', error);
|
||||||
if (typeof stateObject != 'string') language = stateObject.language;
|
// }
|
||||||
|
// if (typeof stateObject != 'string') language = stateObject.language;
|
||||||
|
|
||||||
if (error || !authInfo) {
|
if (error || !authInfo) {
|
||||||
this.logger.error(error);
|
this.logger.error(error);
|
||||||
|
|||||||
@@ -37,9 +37,11 @@ export class MagaluIdStrategy extends PassportStrategy(
|
|||||||
super(options, verify);
|
super(options, verify);
|
||||||
}
|
}
|
||||||
|
|
||||||
authenticate(req: Request, options: Record<string, any>) {
|
// authenticate(req: Request, options: Record<string, any>) {
|
||||||
const language = req.headers['dadosfera-lang'] || req.query.language;
|
// const language =
|
||||||
options.state = jwt.sign({ language }, process.env.JWT_PRIVATE_KEY);
|
// req.headers['dadosfera-lang'] || req.query.language || 'pt-br';
|
||||||
super.authenticate(req, options);
|
// // options.state = jwt.sign({ language }, process.env.JWT_PRIVATE_KEY);
|
||||||
}
|
// super.authenticate(req, options);
|
||||||
|
// console.log('authenticate', JSON.stringify(options));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user