mirror of
https://github.com/h44z/wg-portal.git
synced 2026-04-15 12:06:21 +00:00
OIDC - support IdP logout (#670)
* OIDC - support IdP logout Signed-off-by: Michael Tupitsyn <michael.tupitsyn@gmail.com> * Add support of logout_idp_session parameter Signed-off-by: Michael Tupitsyn <michael.tupitsyn@gmail.com> * Fix merge conflict issue Signed-off-by: Michael Tupitsyn <michael.tupitsyn@gmail.com> * Restore original package-lock.json Signed-off-by: Michael Tupitsyn <michael.tupitsyn@gmail.com> * Cleanup --------- Signed-off-by: Michael Tupitsyn <michael.tupitsyn@gmail.com> Co-authored-by: Christoph Haas <christoph.h@sprinternet.at>
This commit is contained in:
@@ -108,12 +108,19 @@ export const authStore = defineStore('auth',{
|
||||
this.setUserInfo(null)
|
||||
this.ResetReturnUrl() // just to be sure^^
|
||||
|
||||
let logoutResponse = null
|
||||
try {
|
||||
await apiWrapper.post(`/auth/logout`)
|
||||
logoutResponse = await apiWrapper.post(`/auth/logout`)
|
||||
} catch (e) {
|
||||
console.log("Logout request failed:", e)
|
||||
}
|
||||
|
||||
const redirectUrl = logoutResponse?.RedirectUrl
|
||||
if (redirectUrl) {
|
||||
window.location.href = redirectUrl
|
||||
return
|
||||
}
|
||||
|
||||
notify({
|
||||
title: "Logged Out",
|
||||
text: "Logout successful!",
|
||||
|
||||
Reference in New Issue
Block a user