Detailed description of problem
After login (in my way its microsoft - azure) , expo gives me this error :
Log saying :
In my opinion there’s problem with redirecting back from google chrome login, safari (iOS) is openning directly into expo app, while android has to open external source of browser
There is some source code:
// Endpoint
const discovery = useAutoDiscovery(
`https://login.microsoftonline.com/${tenantID}/v2.0`
);
// Request
const [request, response, promptAsync] = useAuthRequest(
{
clientId: process.env.EXPO_PUBLIC_CLIENT_ID,
scopes: ["openid", "profile", "email", "offline_access", "User.Read.All"],
redirectUri: process.env.EXPO_PUBLIC_REDIRECT_URI,
},
discovery
);
Am using method from expo documentation
Login source
const handleLogin = async () => {
try {
const codeResponse = await promptAsync();
if (request && codeResponse?.type === "success" && discovery) {
const res = await exchangeCodeAsync(
{
clientId,
code: codeResponse.params.code,
extraParams: request.codeVerifier
? { code_verifier: request.codeVerifier }
: undefined,
redirectUri,
},
discovery
);
setToken(res.accessToken);
await gettingAllDatas(); // Fetch and store data here
}
} catch (error) {
console.error("Error handling login:", error);
}
};
Thanks for your responses