0

I am using msal-react in my single page B2C application to sign in. I used the loginRedirect() function to login.

const { instance } = useMsal();
let {idToken} = await instance.loginRedirect();

This is allowing me to login successfully.

After login when I check if the user is authenticated using the following function it is returning true.

import {useIsAuthenticated,} from "@azure/msal-react";

const isAuthenticated = useIsAuthenticated();

That means that the user is authenticated.

But when I use the logoutRedirect function to logout the user. it is properly getting redirected to the logout-redirect-uri. But, it is still persisting the session somehow. Again if I try to login it is not asking for the credentials. Instead, it is taking me to the screen when it will ask me to sent the token to my registered mobile number.

await instance.logoutRedirect();

Can anybody suggest a way to remove the entire session and ask the user to enter the credentials again after logging out?

Sundeep
  • 375
  • 2
  • 4
  • 16

0 Answers0