Skip to content

Commit

Permalink
Redirect to confirmation page on logout - #982
Browse files Browse the repository at this point in the history
  • Loading branch information
libpitt committed Oct 17, 2023
1 parent 92ce608 commit 33e20df
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions src/components/custom/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,6 @@ export function goToSearch() {
goIntent('search')
}

export function gotToLogin() {
goIntent('login')
}

export function getEntityViewUrl(entity, uuid, {isEdit = false}) {
const pre = isEdit ? '/edit' : ''
return pre + "/" + entity?.toLowerCase() + "?uuid=" + uuid
Expand Down
5 changes: 1 addition & 4 deletions src/pages/logout.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { useEffect, useContext } from 'react'
import Spinner from '../components/custom/Spinner'
import AppContext from '../context/AppContext'
import { gotToLogin } from '../components/custom/js/functions'
import { getLogoutURL } from '../config/config'

function logout() {
const { logout } = useContext(AppContext)
useEffect(() => {
const xhr = new XMLHttpRequest()
xhr.open('GET', getLogoutURL(), true)
logout()
gotToLogin()
window.location = getLogoutURL()
})
return <Spinner text="Logging you out, please wait... " />
}
Expand Down

0 comments on commit 33e20df

Please sign in to comment.