fix save uri to query and get it

This commit is contained in:
Chika 2022-12-06 23:38:28 +03:00
parent fb1ada5a73
commit 3bb7e1a850
2 changed files with 8 additions and 9 deletions

View File

@ -29,14 +29,7 @@ export class AuthController {
private getTargetUri(req) {
const refererURL = new URL(req?.headers?.referer);
const uri = refererURL.searchParams.get('uri');
if (uri) return uri;
if (refererURL.pathname.includes('/login')) {
return refererURL.href.split('/login')[1] || '/';
}
return '/';
return refererURL.searchParams.get('uri') || '/';
}
private getInvalidPasswordUrl(targetUri: string) {

View File

@ -20,7 +20,13 @@ http {
listen 80;
include /etc/nginx/mime.types;
error_page 401 /login;
error_page 401 @error401;
location @error401 {
add_header Cache-Control 'no-store, no-cache';
rewrite ^ /login?uri=$request_uri permanent;
}
location = /auth {
internal;