wavlake / mobile

MIT License
8 stars 0 forks source link

logged in user is redirected to login screen after reinstalling the app #51

Closed SamSamskies closed 1 year ago

SamSamskies commented 1 year ago

user should not be redirected to login screen if they have a nostr private stored in secure storage.

steps to recreate:

  1. login
  2. uninstall app from phone while still logged in
  3. reinstall the app
  4. open app (login screen is shown when it shouldn't be)

bug is most likely here: https://github.com/wavlake/mobile/blob/94b4e75b61ada239ea89f50db58f005718936ae9/app/(drawer)/(tabs)/_layout.tsx#L32-L45

it should short circuit on line 33, but it doesn't for some reason. probably better to check if pubkey available directly in the async function instead of using the useAuth hook.

SamSamskies commented 1 year ago

on 2nd thought, if there is a stored private key on 1st app launch, we should delete it and make user login again.