DefineX-Studios / MasjidBuddy

Application that provides a platform for local masjids to provide services online.
MIT License
0 stars 0 forks source link

Relaunching doesn't reauthenticates #42

Closed adsau59 closed 4 months ago

adsau59 commented 4 months ago

while working on #39 I noticed a problem with the current auth implementation


Current implementation:

  1. when user signs in, they are authenticated with supabase, for which they receive an access and a refresh token which is saved in storage (Note that, supabase is using the token when making the following requests after that)
  2. when the user closes and opens the app back again, it sees that it already has the tokens in the storage, so it decides not to authenticate again. (Note that, supabase is not authenticated in this session)
  3. when the requests are made which uses user's context, they now fail as user is not authenticated.

Possible solutions:

  1. use the refresh token to authenticate again OR
  2. set the session when the app reopens.
adsau59 commented 4 months ago

done