mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-17 02:29:10 +00:00
finish rudimentary auth flow
This commit is contained in:
parent
90f302c103
commit
cfc623b228
10 changed files with 101 additions and 15 deletions
|
@ -19,7 +19,19 @@ export const userInit = async dispatch => {
|
|||
})
|
||||
|
||||
dispatch(fetchServers)
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
} catch (e) {
|
||||
if (!window.location.pathname.startsWith('/oauth')) {
|
||||
window.location.href = '/oauth/flow'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const userLogout = async dispatch => {
|
||||
await superagent.post('/api/auth/logout')
|
||||
|
||||
dispatch({
|
||||
type: Symbol.for('reset user')
|
||||
})
|
||||
|
||||
window.location.href = '/'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue