mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-07 05:29:08 +00:00
Merge pull request #332 from dadosfera/feature/sso-openid
Feature/sso openid
This commit is contained in:
@@ -186,11 +186,14 @@ export class IdentityProviderController {
|
||||
this.logger.info('GET /identity-providers/:id');
|
||||
|
||||
|
||||
const origin = req.headers['origin'] as string;
|
||||
console.log('Origin:', origin);
|
||||
const frontDomain = req.headers['origin'] as string || req.headers['referer'] as string;
|
||||
this.logger.info(`Front domain: ${frontDomain}`);
|
||||
const host = frontDomain.lastIndexOf('/') !== -1
|
||||
? frontDomain.substring(0, frontDomain.lastIndexOf('/'))
|
||||
: frontDomain;
|
||||
|
||||
const lang = language.substring(0, 2) + language.substring(2).toUpperCase();
|
||||
const callbackUrl = process.env.ENV !== "prd" ? `${origin}/auth/callback` : `${origin}/${lang}/auth/callback`;
|
||||
const callbackUrl = process.env.ENV !== "prd" ? `${host}/auth/callback` : `${host}/${lang}/auth/callback`;
|
||||
|
||||
const redirectUrl =
|
||||
await this.identityProviderService.loginIdentityProvider(id, callbackUrl);
|
||||
|
||||
Reference in New Issue
Block a user