Atinux / nuxt-auth-utils

Minimal Auth module for Nuxt 3.
MIT License
617 stars 59 forks source link

Create OAuth provider in userland code #59

Open thijsw opened 4 months ago

thijsw commented 4 months ago

I'm curious about the possibility of writing an OAuth provider in userland code. I'm currently interacting with one that doesn't seem to justify inclusion in this library due to its limited usage within a small region. Can anyone provide insights on how this can be achieved? Thank you!

Atinux commented 4 months ago

This is a good question @thijsw

You can copy / paste https://github.com/Atinux/nuxt-auth-utils/blob/main/src/runtime/server/lib/oauth/github.ts in ~/server/utils/my-custom-oauth.ts for example, then update the different urls and create an API route using your exported server util (it will be auto-imported, you may have to restart your server after creating the server util)

navanjr commented 2 weeks ago

What does "userland code" mean in this context?

niko-chaffinchicas commented 1 week ago

@navanjr My assumption is that "userland code" refers to being able to define an OAuth provider in your project where you install nuxt-auth-utils, rather than in the package itself.