Nuxt Auth Utils provides a collection of social logins that you can use in your site.
Supersaas provides two examples, one for Google and one for Github. You can find the code in
server/api/auth/google.get.js
server/api/auth/github.get.js
All you need to do is set the respective providers credentials in you .env
file.
or if you need a more explicit way, you can set them in your nuxt.config.ts
file
export default defineNuxtConfig({
runtimeConfig: {
oauth: {
<provider>: {
clientId: process.env.NUXT_OAUTH_<PROVIDER>_CLIENT_ID,
clientSecret: process.env.NUXT_OAUTH_<PROVIDER>_CLIENT_SECRET,
}
}
}
})
Please find more about Nuxt Auth Utils here