(token: string)
| 8 | } |
| 9 | |
| 10 | export function decode(token: string) { |
| 11 | try { |
| 12 | const decoded = jwt.verify(token, privateKey); |
| 13 | |
| 14 | return { valid: true, expired: false, decoded }; |
| 15 | } catch (error) { |
| 16 | return { |
| 17 | valid: false, |
| 18 | expired: error.message === "jwt expired", |
| 19 | decoded: null, |
| 20 | }; |
| 21 | } |
| 22 | } |
no outgoing calls
no test coverage detected