@@ -44,7 +44,16 @@ export class AuthService {
|
||||
|
||||
async createAuthorizationRedirect(returnTo?: string) {
|
||||
const client = await this.getClient();
|
||||
const redirectUri = this.config.get<string>('AUTH_CALLBACK_URL') || `${this.config.get('APP_URL') || ''}/auth/callback`;
|
||||
const redirectUri =
|
||||
this.config.get<string>('AUTHENTIK_REDIRECT_URI') ??
|
||||
this.config.get<string>('AUTH_CALLBACK_URL') ??
|
||||
`${this.config.get<string>('APP_URL')}/auth/callback`;
|
||||
|
||||
if (!redirectUri) {
|
||||
throw new Error(
|
||||
'No redirect URI configured. Set AUTHENTIK_REDIRECT_URI or AUTH_CALLBACK_URL.',
|
||||
);
|
||||
}
|
||||
|
||||
const state = require('crypto').randomUUID();
|
||||
const code_verifier = generators.codeVerifier();
|
||||
|
||||
Reference in New Issue
Block a user