I followed the tutorial on https://docs.expo.dev/guides/authentication/#descope. It says that i can use the below for redirectURI
const redirectUri = AuthSession.makeRedirectUri();
However, it does work when I run the app using npx expo start
However, when I submit to app store, it just says
{"errorCode":"E011003","errorDescription":"Request is invalid","errorMessage":"The redirect_uri field must have a hostname","message":"The redirect_uri field must have a hostname"}
Below is my code
const descopeProjectId = "xxxxxx";
const descopeUrl = `https://api.descope.com/${descopeProjectId}`;
const redirectUri = AuthSession.makeRedirectUri();
export default function SignupOrLogin() {
const [authTokens, setAuthTokens] = React.useState(null);
const [userInfo, setUserInfo] = React.useState(null);
const discovery = AuthSession.useAutoDiscovery(descopeUrl);
const [userProfile, setUserProfile] = useState<UserProfile>({} as UserProfile)
const [request, response, promptAsync] = AuthSession.useAuthRequest(
{
clientId: descopeProjectId,
responseType: AuthSession.ResponseType.Code,
redirectUri,
usePKCE: true,
scopes: ["openid", "profile", "email"],
},
discovery
);
I have attempted to search online for something else, but I’m not quite sure what to substitude for redirectUri.
Thanks a lot for your help!
New contributor
Michael Wu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.