Skip to content

Commit

Permalink
fix(core): auth methods with cookies (#4723)
Browse files Browse the repository at this point in the history
  • Loading branch information
allardy committed Mar 19, 2021
1 parent 7ad4a65 commit 39fc418
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bp/pro
Submodule pro updated from e72f52 to a4cba5
11 changes: 8 additions & 3 deletions src/bp/ui-admin/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ export const makeMainRoutes = () => {
setupBranding()

const ExtractToken = () => {
const token = extractCookie('userToken')
if (token) {
authentication.setToken({ jwt: token })
const userToken = extractCookie('userToken')
const tokenExpiry = extractCookie('tokenExpiry')

if (userToken) {
authentication.setToken({
[window.USE_JWT_COOKIES ? 'csrf' : 'jwt']: userToken,
exp: Date.now() + Number(tokenExpiry)
})
}

// eslint-disable-next-line @typescript-eslint/no-floating-promises
Expand Down

0 comments on commit 39fc418

Please sign in to comment.