Rank 2: Process
I'm trying to use custom tokens for authenticating a user that uses AppleSignIn in an iOS app.
I don't like the OAuth2 implementation for Apple because it kicks the user out of my app, loads Safari to present the authentication screen, then prompts the user "Do you want to open "MyAppName"?" after authentication before finally returning them to my app - which is much, much less than ideal for the user experience.
So to avoid that, I'm handling the AppleSignIn within the app then sending the identityToken to an appwrite function that validates it, then creates an Appwrite user account and generates a custom token (with a 5 minute expiry) that gets returned to the app.
The app exchanges the custom token for a session with:
Accounts.createSession(userId: secret:)
That all works - but the providerRefreshToken value is blank and I'm unsure of how to handle refreshing the session.
What is the recommended way to refresh an Appwrite session that was created using a custom token?