@plutocms/supabase 0.0.1-alpha.13 → 0.0.1-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/css/tailwind.css +2 -0
- package/app/composables/auth.ts +68 -0
- package/app/middleware/auth.ts +15 -9
- package/app/pages/admin/(auth)/forgot-password.vue +88 -0
- package/app/pages/admin/(auth)/login.vue +5 -1
- package/app/pages/admin/(auth)/update-password.vue +120 -0
- package/app/pages/admin/setup.vue +1 -1
- package/bun.lock +435 -652
- package/nuxt.config.ts +7 -1
- package/package.json +6 -5
- package/server/api/auth/reset-password.post.ts +36 -0
package/nuxt.config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default defineNuxtConfig({
|
|
2
|
-
extends: [['
|
|
2
|
+
extends: [['../../plutocms/pluto/', { install: true }], '@plutocms/utils'],
|
|
3
3
|
|
|
4
4
|
modules: ['@nuxt/eslint', '@nuxtjs/supabase'],
|
|
5
5
|
|
|
@@ -24,6 +24,12 @@ export default defineNuxtConfig({
|
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
+
vite: {
|
|
28
|
+
optimizeDeps: {
|
|
29
|
+
include: ['yup'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
|
|
27
33
|
eslint: {
|
|
28
34
|
config: {
|
|
29
35
|
nuxt: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plutocms/supabase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.1-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.15",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "nuxt build",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@nuxt/ui": "^4.5.1",
|
|
19
|
-
"@nuxtjs/supabase": "2.0.
|
|
19
|
+
"@nuxtjs/supabase": "^2.0.4",
|
|
20
20
|
"@plutocms/pluto": "^0.0.1-alpha.4",
|
|
21
21
|
"@plutocms/utils": "^0.0.1-alpha.5",
|
|
22
22
|
"postgres": "^3.4.8",
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"@types/bun": "^1.3.10",
|
|
30
30
|
"@vueuse/nuxt": "^14.2.1",
|
|
31
31
|
"eslint": "^9.39.1",
|
|
32
|
-
"nuxt": "^4.
|
|
32
|
+
"nuxt": "^4.4.2",
|
|
33
33
|
"prettier": "^3.8.1",
|
|
34
|
-
"
|
|
35
|
-
"vue
|
|
34
|
+
"tailwindcss": "^4.2.2",
|
|
35
|
+
"vue": "^3.5.30",
|
|
36
|
+
"vue-router": "^5.0.3"
|
|
36
37
|
},
|
|
37
38
|
"trustedDependencies": [
|
|
38
39
|
"@parcel/watcher",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { serverSupabaseClient } from '#supabase/server'
|
|
2
|
+
|
|
3
|
+
interface Payload {
|
|
4
|
+
email: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default defineEventHandler(async (event) => {
|
|
8
|
+
const client = await serverSupabaseClient<Database>(event)
|
|
9
|
+
const body = await readBody<Payload>(event)
|
|
10
|
+
|
|
11
|
+
if (!body.email) {
|
|
12
|
+
return {
|
|
13
|
+
success: false,
|
|
14
|
+
message: 'Email is required.',
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { origin } = getRequestURL(event)
|
|
19
|
+
|
|
20
|
+
const { error } = await client.auth.resetPasswordForEmail(body.email, {
|
|
21
|
+
redirectTo: `${origin}/admin/update-password`,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
if (error) {
|
|
25
|
+
return {
|
|
26
|
+
success: false,
|
|
27
|
+
message: error.message,
|
|
28
|
+
error,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
success: true,
|
|
34
|
+
message: 'Password reset email sent.',
|
|
35
|
+
}
|
|
36
|
+
})
|