Skip to content

Commit

Permalink
Merge pull request #155 from JoinColony/fix/check-jwt-sig
Browse files Browse the repository at this point in the history
Verify JWT Signature
  • Loading branch information
rdig authored Oct 30, 2024
2 parents c97fd60 + b5f31ce commit 97d25c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@ export const getAddressFromToken = (token: string) => {
throw new Error('Authentication token expired')
}

// Verify the JWT signature
JWT.verify(token, JWT_KEY, {
algorithms: ['HS256'],
audience: 'https://api.colony.io',
issuer: 'https://colony.io',
})

return address
}

0 comments on commit 97d25c0

Please sign in to comment.