From 1274c2c53794482c47d38a894c16cb0562c358e6 Mon Sep 17 00:00:00 2001 From: April Mintac Pineda Date: Tue, 21 Sep 2021 14:00:35 +0800 Subject: [PATCH] deleteToken on logout --- src/fluxible/actions/user.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fluxible/actions/user.js b/src/fluxible/actions/user.js index d8b182c..8742e3a 100644 --- a/src/fluxible/actions/user.js +++ b/src/fluxible/actions/user.js @@ -1,3 +1,4 @@ +import messaging from '@react-native-firebase/messaging'; import { store, updateStore } from 'fluxible-js'; import { logLogin, logLogout } from 'libs/logging'; import { xhr } from 'libs/xhr'; @@ -10,6 +11,8 @@ export function login ({ userData, authToken }) { export function logout () { logLogout(); + messaging().deleteToken(); + xhr('/logout', { method: 'post', authToken: store.authToken