You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When you run on Google Cloud, you often can rely on the default application credentials. So there isn't a need to store the private key in an environment variable. Instead it would be preferred to load the firebase admin using this code:
var admin = require('firebase-admin');
var app = admin.initializeApp();
Describe the solution you'd like and how you'd implement it
Change the behaviour such that when no firebaseAdminInitConfig is specified it will initialize the app using the following code:
admin.initializeApp()
Is this a breaking change?
Would this require existing users to change how they're using next-firebase-auth?
It wouldn't be a breaking change because existing users that have the firebaseAdminConfig will continue to work as is
I will happily provide a PR for this change if this is something that you would accept.
The text was updated successfully, but these errors were encountered:
samos123
added a commit
to samos123/next-firebase-auth
that referenced
this issue
Feb 15, 2021
Try to load default credentials if no firebaseAdminInitConfig is
provided. This way no private key needs to be set as environment
variable.
For reference:
gladly-team#75
This makes sense. However, I'd like to also preserve the error for the users who accidentally don't provide any credentials. Ideally:
If the user provided a credential, init as we currently do.
If the user did not provide a credential, try admin.initializeApp(). If it fails because of an invalid or missing app credential, throw the existing error (If not initializing the Firebase admin SDK elsewhere, you must provide "firebaseAdminInitConfig" to next-firebase-auth.) I'm not sure what error code the admin app uses for a failed init.
Just FYI, as a fairly straightforward workaround, you can initialize Firebase yourself before initializing next-firebase-auth. See the pattern here.
I tried the latest version and this was working out of the box now when setting useFirebaseAdminDefaultCredential: true,. Thank you for the great library and making it work easily on GCP environments!
Is your feature request related to a problem? Please describe.
When you run on Google Cloud, you often can rely on the default application credentials. So there isn't a need to store the private key in an environment variable. Instead it would be preferred to load the firebase admin using this code:
For reference see: https://firebase.google.com/docs/admin/setup
Describe the solution you'd like and how you'd implement it
Change the behaviour such that when no
firebaseAdminInitConfig
is specified it will initialize the app using the following code:Is this a breaking change?
Would this require existing users to change how they're using
next-firebase-auth
?It wouldn't be a breaking change because existing users that have the firebaseAdminConfig will continue to work as is
I will happily provide a PR for this change if this is something that you would accept.
The text was updated successfully, but these errors were encountered: