Skip to content

Commit

Permalink
bug fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
simonkernel committed Jun 10, 2022
1 parent 4575de1 commit b882399
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/auth/src/routes/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ const register = async (server, rpcPath, { seed, authMemberId, rpcEndpoint }) =>
const { authPayload, jwt, persist } = await rpcService.call(service, fn, params)
if (persist) {
// TODO: set expires, set env properly
//const maxAge = authPayload.exp - Date.now()
const opts = {
domain: DOMAIN,
maxAge: 60 * 60 * 24,
maxAge: 60 * 60 * 20,
sameSite: 'none',
secure: true,
httpOnly: true,
Expand All @@ -74,7 +75,7 @@ const register = async (server, rpcPath, { seed, authMemberId, rpcEndpoint }) =>
reply.setCookie('stagingJWT', jwt, opts)
reply.setCookie('stagingUser', JSON.stringify(authPayload), {
domain: DOMAIN,
maxAge: 60 * 60 * 24,
maxAge: 60 * 60 * 20,
secure: true,
sameSite: 'none',
path: '/'
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/rpcClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const build = async ({ rpcEndpoint, jwtFn }) => {
const jwt = await jwtFn.call()
const headers = { 'Content-Type': 'application/json' }
if (jwt) {
Object.assing(headers, { Authorization: `Bearer ${jwt}` })
Object.assign(headers, { Authorization: `Bearer ${jwt}` })
}
const opts = {
method: 'POST',
Expand Down

0 comments on commit b882399

Please sign in to comment.