Skip to content

Commit

Permalink
Move token prefixes to const
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Nov 9, 2023
1 parent e4a3f93 commit e6d1f5d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/seam/connect/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,21 @@ export const warnOnInsecureuserIdentifierKey = (

const tokenPrefix = 'seam_'

const accessTokenPrefix = 'seam_at'

const jwtPrefix = 'ey'

const clientSessionTokenPrefix = 'seam_cst'

const publishableKeyTokenPrefix = 'seam_pk'

const isClientSessionToken = (token: string): boolean =>
token.startsWith(clientSessionTokenPrefix)

const isAccessToken = (token: string): boolean => token.startsWith('seam_at')
const isAccessToken = (token: string): boolean =>
token.startsWith(accessTokenPrefix)

const isJwt = (token: string): boolean => token.startsWith('ey')
const isJwt = (token: string): boolean => token.startsWith(jwtPrefix)

const isSeamToken = (token: string): boolean => token.startsWith(tokenPrefix)

Expand Down

0 comments on commit e6d1f5d

Please sign in to comment.