web: fix redirect when accessing authentik URLs authenticated
closes #3174 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -43,7 +43,10 @@ export function me(): Promise<SessionUser> {
|
||||
},
|
||||
};
|
||||
if (ex.response.status === 401 || ex.response.status === 403) {
|
||||
window.location.assign("/");
|
||||
const relativeUrl = window.location
|
||||
.toString()
|
||||
.substring(window.location.origin.length);
|
||||
window.location.assign(`/flows/-/default/authentication/?next=${encodeURIComponent(relativeUrl)}`);
|
||||
}
|
||||
return defaultUser;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user