Skip to content

Commit 43fd1ae

Browse files
committed
fix: redirect from OIDC directive
1 parent 5ac75ce commit 43fd1ae

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • src/main/resources/META-INF/resources/webjars/public/login

src/main/resources/META-INF/resources/webjars/public/login/login.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ define([
2828
current.success();
2929
if (result && result.success && result.redirect) {
3030
// Success login, use the provided redirection URL
31-
window.location.replace('//' + location.host + result.redirect + (current.target || '#/'));
31+
const url = new URL(window.location.href);
32+
const pathParts = url.pathname.split('/').filter(function(part) {return part;});
33+
pathParts.pop(); // remove the last part of the path
34+
const newPath = '/' + pathParts.join('/');
35+
window.location.href = `${url.origin}${newPath}`+ (current.target || '#/');
3236
} else {
3337
window.location.replace('?' + mode);
3438
}

0 commit comments

Comments
 (0)