Skip to content

Commit 69588e8

Browse files
committed
feat: add ory provider in playground
1 parent b0da81f commit 69588e8

File tree

6 files changed

+29
-1
lines changed

6 files changed

+29
-1
lines changed

playground/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ NUXT_OAUTH_HEROKU_REDIRECT_URL=
140140
#Ory
141141
NUXT_OAUTH_ORY_CLIENT_ID=
142142
NUXT_OAUTH_ORY_CLIENT_SECRET=
143-
NUXT_OAUTH_ORY_SERVER_URL=
143+
NUXT_OAUTH_ORY_SDK_URL=

playground/app.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ const providers = computed(() =>
248248
disabled: Boolean(user.value?.heroku),
249249
icon: 'i-simple-icons-heroku',
250250
},
251+
{
252+
label: user.value?.ory || 'Ory',
253+
to: '/auth/ory',
254+
disabled: Boolean(user.value?.ory),
255+
icon: 'i-custom-ory',
256+
},
251257
].map(p => ({
252258
...p,
253259
prefetch: false,

playground/assets/icons/ory.svg

Lines changed: 1 addition & 0 deletions
Loading

playground/auth.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ declare module '#auth-utils' {
4343
salesforce?: string
4444
slack?: string
4545
heroku?: string
46+
ory?: string
4647
}
4748

4849
interface UserSession {

playground/nuxt.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@ export default defineNuxtConfig({
2727
webAuthn: true,
2828
atproto: true,
2929
},
30+
icon: {
31+
customCollections: [{
32+
prefix: 'custom',
33+
dir: './assets/icons',
34+
}],
35+
},
3036
})

playground/server/routes/auth/ory.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export default defineOAuthOryEventHandler({
2+
config: {},
3+
async onSuccess(event, { user }) {
4+
await setUserSession(event, {
5+
user: {
6+
email: user?.email,
7+
ory: user?.email,
8+
},
9+
loggedInAt: Date.now(),
10+
})
11+
12+
return sendRedirect(event, '/')
13+
},
14+
})

0 commit comments

Comments
 (0)