Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Tweaks to Authentication Recipe #162

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

morganick
Copy link
Contributor

@morganick morganick commented May 16, 2024

Summary

  • Correct onPress action for sign up
  • Denoting initial session storage and edits for encryption
  • Adding missing error style
  • Adding warning about environment variables with EAS build

Thanks to @mazenchami for reporting these!

@morganick morganick self-assigned this May 16, 2024
@morganick morganick requested a review from mazenchami May 17, 2024 14:52
@morganick morganick added the bug Something isn't working label May 17, 2024
@morganick morganick marked this pull request as ready for review May 17, 2024 14:53
"preview:device": {
"env": {
"EXPO_PUBLIC_SUPABASE_URL": "https://<your-project-id>.supabase.co",
"EXPO_PUBLIC_SUPABASE_ANON_KEY": "<your-anon-public-key>"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mazenchami I agree. I'm not really a fan of this as I would much rather this be a secret loaded from EAS Secrets. I realize that this key can be public and even looking through the documentation across Supabase and Expo they just mostly inline it right into the code:

The dynamic config you were talking about referenced here: https://docs.expo.dev/eas-update/environment-variables/#using-variables-in-appconfigjs This appears to be the pre-SDK-49 way of doing things?

Even still we'd be committing those environment variables to the repo because they'd have to exist in eas.json for the particular profile: https://docs.expo.dev/build-reference/variables/#for-use-by-your-expo-config

Honestly, the easiest method is just to push the env into secrets right from the CLI:
https://docs.expo.dev/build-reference/variables/#adding-secrets-with-eas-cli

eas secret:push --scope project --env-file .env

The only issue with this is that they'd be the same across any of the EAS profiles because EAS secrets does not care about which environment they are loaded in.

It feels like there's a missing piece here. What am I missing?

@frankcalise thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Two thoughts:

  1. You don't have to solve that problem of environments here, as that could be explained in detail elsewhere (for example, this recipe which is an older Ignite 8 one that should be more inline with Expo builds
  2. But on how to actually execute different vars per environment, you would likely define some env in eas.json for example, like APP_VARIANT or APP_ENV in each one. Then in the dynamic config, app.config.ts, switch off that to call on the proper secrets. You'd have to store unique secrets per environment in this case, so prefixing them in some consistent way I guess would work.

It would be cool though, if there was a dropdown in the dashboard (and eas secret command) to specify that it belongs to a specific build profile. Maybe there is a reason they don't have that but I'll bring it up at Appjs next week

Choose a reason for hiding this comment

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

I agree with Frank's thoughts here, mainly: "You don't have to solve that problem of environments here..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants