Implement both native authentication and OAuth into your application
To implement native authentication and OAuth, you can use SvelteKit’s Sequence helper function.
In your existing hooks.server.ts file, add the following:
Copy
import { sequence } from '@sveltejs/kit/hooks';/*NOTE: CANNOT HAVE 2 HANDLE FUNCTIONS!export const handle = SvaultNative(redirectPath);export const handle = SvaultOauth({ providers });*/// Rename functions to their corresponding type of authenticationexport const native = SvaultNative(redirectPath);export const oauth = SvaultOauth({ providers });// Use sveltekit sequence method to run both hooks in sequenceexport const handle = sequence(oauth, native);