diff --git a/mobile/src/pages/auth/Login.tsx b/mobile/src/pages/auth/Login.tsx index 0c7a05ee1..1aed76e9b 100644 --- a/mobile/src/pages/auth/Login.tsx +++ b/mobile/src/pages/auth/Login.tsx @@ -24,12 +24,8 @@ export const Login = (props: ActiveScreenProps) => { }) // GET call for Login Context (settings for social logins, email link etc) const { data: loginContext, mutate } = useFrappeGetCall('raven.api.login.get_context', { - "redirect-to": "/raven" - }, 'raven.api.login.get_context', { - revalidateIfStale: false, - revalidateOnReconnect: false, - revalidateOnFocus: false - }) + "redirect-to": "/raven_mobile" + }, 'raven.api.login.get_context') const [error, setError] = useState(null) const { login } = useFrappeAuth() @@ -58,6 +54,8 @@ export const Login = (props: ActiveScreenProps) => { } } + console.log(loginContext) + return ( <>
diff --git a/mobile/src/utils/auth/UserProvider.tsx b/mobile/src/utils/auth/UserProvider.tsx index eba2d054e..5118d57e0 100644 --- a/mobile/src/utils/auth/UserProvider.tsx +++ b/mobile/src/utils/auth/UserProvider.tsx @@ -28,15 +28,19 @@ export const UserProvider: FC = ({ children }) => { const isLoggedIn = currentUser !== undefined && currentUser !== null && currentUser !== "Guest" const handleLogout = async () => { - return logout() - .then(() => { - //Clear cache on logout - return mutate(() => true, undefined, false) - }) - .then(() => { - // @ts-expect-error - window.frappePushNotification?.disableNotification() - }) + // @ts-expect-error + window.frappePushNotification?.disableNotification() + .then(() => logout()) + .then(() => { + //Clear cache on logout + return mutate((key) => { + if (key === 'raven.api.login.get_context'){ + return false + } + return true + }, undefined, false) + }) + } const handleLogin = async (username: string, password: string) => {