Please provide the following:
- SDK Version: 42
- Platforms(Android/iOS/web/all): android running on device directly
- Add the appropriate “Tag” based on what Expo library you have a question on.
@expo-auth-session
The question is, why the first time, the prompt auth0 is showed and the next time it doesn’t show anymore. I put the prompt: prompt: ‘SelectAccount’,
import React, { useState, useEffect } from "react"
import { StyleSheet, View, Text, Button, Image, Platform } from "react-native"
import { StatusBar } from 'expo-status-bar'
import {
setAuthenticated,
setUserProfile,
setToken
} from "../../features/program"
import { useDispatch } from "react-redux"
import AsyncStorage from "@react-native-async-storage/async-storage"
import * as WebBrowser from 'expo-web-browser';
import * as AuthSession from 'expo-auth-session';
import jwtDecode from 'jwt-decode';
// close, poppup de auth0, una vez que el usuario hace clic
WebBrowser.maybeCompleteAuthSession();
const redirect = "https://auth.expo.io/@xmazzuce/beathey-mobile";
const useProxy = Platform.select({ web: false, default: true });
const redirectUri = AuthSession.makeRedirectUri({ useProxy });
export default function Login() {
const dispatch = useDispatch();
// create and load, una solicitud a auth0
const [request, result, promptAsync] = AuthSession.useAuthRequest(
{
redirectUri: redirect,
clientId: clientId,
// id_token will return a JWT token
responseType: 'id_token',
// retrieve the user's profile
// offline_access: para que devuelta un token de actualización
scopes: ['openid', 'profile', 'offline_access'],
**prompt: 'SelectAccount',**
extraParams: {
// ideally, this will be a random value
nonce: 'nonce',
},
},
{ authorizationEndpoint }
);