Is there google autentication integrated with mail autentication in wasp?

I would like to add google autentication to my website too, is there a way to do that?
3 Replies
MEE6
MEE62mo ago
Wohooo @skyblade2954, you just became a Waspeteer level 1!
kapa.ai
kapa.ai2mo ago
Hi @skyblade2954. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, Wasp supports both Google and email authentication out of the box. You can enable Google authentication to let your users log in using their existing Google accounts, which can greatly simplify the process and enhance the user experience source (https://wasp-lang.dev/docs/auth/social-auth/google). To enable Google authentication, you need to follow these steps: 1. Enable Google authentication in the Wasp file. 2. Add the User entity. 3. Create a Google OAuth app. 4. Add the necessary Routes and Pages. 5. Use Auth UI components in your Pages. Here's a skeleton of how your main.wasp should look like after you're done:
// Configuring the social authentication
app myApp {
auth: { ... }
}

// Defining entities
entity User { ... }

// Defining routes and pages
route LoginRoute { ... }
page LoginPage { ... }
// Configuring the social authentication
app myApp {
auth: { ... }
}

// Defining entities
entity User { ... }

// Defining routes and pages
route LoginRoute { ... }
page LoginPage { ... }
source (https://wasp-lang.dev/docs/auth/social-auth/google#setting-up-google-auth) For email authentication, Wasp provides you with the server-side implementation and email templates for all of these flows. However, Wasp currently doesn't support multiple auth identities for a single user. This means, for example, that a user can't have both an email-based auth identity and a Google-based auth identity. This is something Wasp will add in the future with the introduction of the account merging feature source (https://wasp-lang.dev/docs/auth/email). To set up email authentication, you need to: 1. Enable email authentication in the Wasp file. 2. Add the User entity. 3. Add the auth routes and pages. 4. Use Auth UI components in your pages. 5. Set up the email sender. Here's a skeleton of how your main.wasp should look like after you're done:
// Configuring e-mail authentication
app myApp {
auth: { ... }
}

// Defining User entity
entity User { ... }

// Defining routes and pages
route SignupRoute { ... }
page SignupPage { ... }
// ...
// Configuring e-mail authentication
app myApp {
auth: { ... }
}

// Defining User entity
entity User { ... }

// Defining routes and pages
route SignupRoute { ... }
page SignupPage { ... }
// ...
source (https://wasp-lang.dev/docs/auth/email) Please note that you will need to create a Google Cloud Platform account and a Google project to get your client key and secret for Google authentication source (https://wasp-lang.dev/docs/auth/social-auth/google#3-creating-a-google-oauth-app). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @skyblade2954, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Vinny (@Wasp)
Vinny (@Wasp)2mo ago
Hey there. Kapa provided the right instructions. Did you check out the docs it referenced and get it working?
OpenSaaS.sh
Authentication
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.