apps/api: fix get redirect uri
This commit is contained in:
parent
8ed67d5442
commit
fb1ada5a73
@ -29,13 +29,14 @@ export class AuthController {
|
||||
private getTargetUri(req) {
|
||||
const refererURL = new URL(req?.headers?.referer);
|
||||
|
||||
const targetUrl = refererURL.searchParams.get('uri') || refererURL.pathname;
|
||||
const uri = refererURL.searchParams.get('uri');
|
||||
if (uri) return uri;
|
||||
|
||||
if (!targetUrl || targetUrl.includes('/login')) {
|
||||
return '/';
|
||||
if (refererURL.pathname.includes('/login')) {
|
||||
return refererURL.href.split('/login')[1] || '/';
|
||||
}
|
||||
|
||||
return targetUrl;
|
||||
return '/';
|
||||
}
|
||||
|
||||
private getInvalidPasswordUrl(targetUri: string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user