Skip to content

Commit 8af28ea

Browse files
Add auth/gitlab/index.json.ts file
1 parent e78c045 commit 8af28ea

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/routes/auth/gitlab/index.json.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//first parameter is the strategy name
2+
//second paramater are passport options (usually you'll only use the "scope" property)
3+
import { loginMethod } from 'sveltekit-passport-oauth2';
4+
5+
export const get = loginMethod('gitlab', { scope: ['email', 'profile'] });

src/routes/index.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
<h1>Welcome to SvelteKit</h1>
2-
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
1+
<hr />
2+
<a href="/auth/gitlab.json"rel="external">Login</a>
3+
<hr />
4+
<a href="/auth/gitlab.json" rel="external">Logout</a>
5+
<hr />

0 commit comments

Comments
 (0)