Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 914be2d

Browse files
authored
🩹 Hotfix / Support old Token v2 (#21)
* 🩹 Hotfix / Support old Token v2
1 parent 416fe1c commit 914be2d

File tree

4 files changed

+12672
-7577
lines changed

4 files changed

+12672
-7577
lines changed

example/src/components/HorizontalDivider.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-ignore
12
import React from 'react';
23
import { StyleSheet, View } from 'react-native';
34

example/src/components/LoadingView.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-ignore
12
import React from 'react';
23
import { ActivityIndicator, Text, View } from 'react-native';
34
import { styles } from '../styles';

src/utils/jwt.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ export const validatesAudience = (
122122
config: PreparedCryptrConfig
123123
): void | boolean => {
124124
const expectedAudience =
125-
jwtBody.jtt === 'openid' ? config.clientId : config.audience;
125+
jwtBody.jtt === 'openid' && jwtBody.ver === 3
126+
? config.clientId
127+
: config.audience;
126128
if (jwtBody.aud !== expectedAudience) {
127129
throw new Error(
128130
`Audience (aud) ${jwtBody.aud} claim is not compliant with ${expectedAudience} from config`

0 commit comments

Comments
 (0)