This demo app demonstrates how to use Firebase authentication in a Nuxt.js application.
Create your project in the Firebase Console.
Enable the Google sign-in provider in the Authentication > SIGN-IN METHOD tab.
In the root folder (/
), create a firebase.init.js
file.
Copy and paste the Web snippet code configuration found in the console to the firebase.init.js
file.
You can find the snippet by clicking the "Web setup" button in the Firebase Console
Authentication page.
Ensure the application authorized domain is also whitelisted. localhost
should already be set
as an authorized OAuth domain.
Since the application is using the Firebase Admin SDK, service account credentials will be required. Learn more on how to add the Firebase Admin SDK to your server.
After you generate a new private key, save it in the /server
folder as
serviceAccountKeys.json
.
Make sure to keep these credentials secret and never expose them in public.
To run the demo app, run:
npm run dev
This will launch a local server using port 3000. To access the app, go to http://localhost:3000/login