Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: google # persistence and auth state #117

Merged
merged 17 commits into from
Apr 24, 2024
Merged

Conversation

Aidasvenc
Copy link
Collaborator

@Aidasvenc Aidasvenc commented Apr 23, 2024

What I did

Re-implemented Google # so that no native modules are required on runtime. The Google # functionality only works in builds, but the whole app is now once again fully testable with Expo Go. Bonus: Google # also works on iOS.

Furthermore, an authentication state persistence was implemented so that users remain signed-in even when the app is closed and re-opened.

Finally, the Login and Logout flow is now fully implemented with the authentication stack (now renamed to MainStack) returning either the Authentication flow or HomeTabs based on the user's auth state.

All of these functionalities are demonstrated in the demo.

How I did it

  • Used only the firebase SDK to implement google #.
  • Used expo-auth-session and expo-crypto as well as expo-web-browser to handle authentication tokens and redirection to/from a google login web page.
  • Used exposed auth methods and AsyncStorage to keep track of the authentication state and persist it.

How to verify it

  • Test the simple login/logout flow use npx expo start --go
  • Test Google Sign-in with a newest build from eas or run it locally with npx expo prebuild and then npm run android

Demo video

WhatsApp.Video.2024-04-23.at.12.27.13_b9a93d9d.mp4

Pre-merge checklist

The changes I have introduced:

  • work correctly
  • do not break other functionalities
  • work correctly on Android
  • are fully tested

@GaelCondeLosada
Copy link
Collaborator

It works on my device !

WhatsApp.Video.2024-04-23.at.12.27.13_b9a93d9d.mp4

Copy link
Collaborator

@Fyuryy Fyuryy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job Aidas, LGTM

Copy link

@Aidasvenc Aidasvenc changed the title fix: google # feat: google # persistence and auth state Apr 24, 2024
@Aidasvenc Aidasvenc merged commit 821fc61 into main Apr 24, 2024
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
3 participants