The idea was to use openid-client
package to cover as many auth providers as possible.
There are three pieces of code:
@wasp-lang/auth
package that providescreateOAuthRouter
function that can be used to create a router that can be used to handle OAuth flowapi
that usescreateOAuthRouter
and provides a simple API that can be used to login and get the current userfrontend
that usesapi
to login and gets the current user
Make sure to build and link @wasp-lang/auth
package:
cd packages/wasp-auth
npm run build
npm link
Install the local package in api
with:
cd api
npm link @wasp-lang/auth
Copy env.example
to .env
and fill in the values.
Run the api
with:
npm run dev
Run the frontend
with:
cd frontend
npm run dev