Implementation
OAuth
Implement OAuth into your application
-
When registering your application for OAuth set your callback url to match this format
/oauth/[provider]/validate
. -
In the
src
directory of your project, create ahooks.server.ts
file and paste the following code:
- Create an
.env
file at the root level of your project and define your client ID and secret as variables. Example:
-
In your
+page.svelte
file that has your login page:- Create a button or component for each provider you want to use, that will route to an endpoint of
/oauth/[provider-name-here]/auth
- Make sure to include an anchor tag within the button and/or component.
- Create a button or component for each provider you want to use, that will route to an endpoint of
OAuth providers are not set up to store any data in a database in this current iteration of Svault.