Skip to content

Commit

Permalink
Merge pull request #203 from SquareTable/197-app-doesnt-resend-notifi…
Browse files Browse the repository at this point in the history
…cation-key-if-it-has-been-sent-before

Fixed app not sending notification key on login
  • Loading branch information
Sebastian-Webster authored Sep 20, 2023
2 parents 9bfeec4 + 423cac9 commit 4c75219
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/HandleLogout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export function Logout(storedCredentials, setStoredCredentials, allCredentialsSt
Promise.all([
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-web-token'),
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token'),
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token-id')
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token-id'),
AsyncStorage.removeItem(`deviceNotificationKey-${storedCredentials._id}`)
]).then(() => {
navigation.reset({
index: 0,
Expand All @@ -47,7 +48,8 @@ export function Logout(storedCredentials, setStoredCredentials, allCredentialsSt
Promise.all([
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-web-token'),
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token'),
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token-id')
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token-id'),
AsyncStorage.removeItem(`deviceNotificationKey-${storedCredentials._id}`)
]).then(() => {
navigation.reset({
index: 0,
Expand All @@ -69,7 +71,8 @@ export function Logout(storedCredentials, setStoredCredentials, allCredentialsSt
Promise.all([
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-web-token'),
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token'),
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token-id')
SecureStore.deleteItemAsync(storedCredentials._id + '-auth-refresh-token-id'),
AsyncStorage.removeItem(`deviceNotificationKey-${storedCredentials._id}`)
]).then(() => {
navigation.reset({
index: 0,
Expand Down Expand Up @@ -101,6 +104,9 @@ export async function LogoutOfAllAccounts(allCredentialsStoredList, setStoredCre
}),
...allCredentialsStoredList.map(credentials => {
return SecureStore.deleteItemAsync(credentials._id + '-auth-refresh-token-id')
}),
...allCredentialsStoredList.map(credentials => {
return AsyncStorage.removeItem(`deviceNotificationKey-${credentials._id}`)
})
]

Expand Down

0 comments on commit 4c75219

Please sign in to comment.