Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
fix: don't decode token
Browse files Browse the repository at this point in the history
  • Loading branch information
samerbuna committed Nov 2, 2022
1 parent bd9815e commit 2d13515
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/server/api-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,12 @@ const loginUsingPhoneNumber = async ({
}

const galoyJwtToken = data?.userLogin?.authToken
const token = jwt.decode(galoyJwtToken) as GalowyJwtToken

if (!token || !token.uid) {
return res.status(401).send("Invalid login request")
}

const authSession = {
identity: {
id: token.uid,
uid: token.uid,
uidc: token.uid.slice(-6) + token.uid.slice(-6), // FIXME: Get from backend
id: galoyJwtToken,
uid: galoyJwtToken,
uidc: galoyJwtToken.slice(-6) + galoyJwtToken.slice(-6), // FIXME: Get from backend
phoneNumber,
},
galoyJwtToken,
Expand Down

0 comments on commit 2d13515

Please sign in to comment.