mirror of
https://github.com/open-webui/open-webui
synced 2025-04-10 15:45:45 +00:00
Merge pull request #10323 from iamobservable/feature/frontend-authentication-redirection
feat: Feature/frontend authentication redirection
This commit is contained in:
commit
ea759c4742
@ -28,6 +28,12 @@
|
||||
|
||||
let ldapUsername = '';
|
||||
|
||||
const querystringValue = (key) => {
|
||||
const querystring = window.location.search;
|
||||
const urlParams = new URLSearchParams(querystring);
|
||||
return urlParams.get(key);
|
||||
};
|
||||
|
||||
const setSessionUser = async (sessionUser) => {
|
||||
if (sessionUser) {
|
||||
console.log(sessionUser);
|
||||
@ -39,7 +45,9 @@
|
||||
$socket.emit('user-join', { auth: { token: sessionUser.token } });
|
||||
await user.set(sessionUser);
|
||||
await config.set(await getBackendConfig());
|
||||
goto('/');
|
||||
|
||||
const redirectPath = querystringValue('redirect') || '/';
|
||||
goto(redirectPath);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user