@xenterprises/nuxt-x-auth-better 0.1.1 → 0.2.1
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/README.md
CHANGED
|
@@ -68,7 +68,7 @@ export default defineAppConfig({
|
|
|
68
68
|
### 3. Set environment variables
|
|
69
69
|
|
|
70
70
|
```env
|
|
71
|
-
|
|
71
|
+
NUXT_PUBLIC_X_AUTH_BASE_URL=https://api.example.com
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
## Usage
|
|
@@ -77,16 +77,16 @@ NUXT_PUBLIC_BETTER_AUTH_BASE_URL=https://api.example.com
|
|
|
77
77
|
|
|
78
78
|
```vue
|
|
79
79
|
<script setup>
|
|
80
|
-
const {
|
|
81
|
-
user,
|
|
82
|
-
login,
|
|
83
|
-
logout,
|
|
84
|
-
signup,
|
|
80
|
+
const {
|
|
81
|
+
user,
|
|
82
|
+
login,
|
|
83
|
+
logout,
|
|
84
|
+
signup,
|
|
85
85
|
loginWithOAuth,
|
|
86
86
|
sendMagicLink,
|
|
87
87
|
forgotPassword,
|
|
88
88
|
isLoading,
|
|
89
|
-
isAuthenticated
|
|
89
|
+
isAuthenticated
|
|
90
90
|
} = useXAuth()
|
|
91
91
|
|
|
92
92
|
// Email/password login
|
|
@@ -11,8 +11,8 @@ export function useXAuth() {
|
|
|
11
11
|
const toast = useToast();
|
|
12
12
|
|
|
13
13
|
const authConfig = computed<AuthConfig>(() => appConfig.xAuth as AuthConfig);
|
|
14
|
-
const baseUrl = config.public.
|
|
15
|
-
const authPath = config.public.
|
|
14
|
+
const baseUrl = config.public.x?.auth?.baseUrl || '';
|
|
15
|
+
const authPath = config.public.x?.auth?.authPath || '/auth';
|
|
16
16
|
const fullAuthUrl = `${baseUrl.replace(/\/$/, '')}${authPath.startsWith('/') ? '' : '/'}${authPath}`;
|
|
17
17
|
|
|
18
18
|
if (!authClientInstance) {
|
package/nuxt.config.ts
CHANGED
|
@@ -6,7 +6,7 @@ export default defineNuxtConfig({
|
|
|
6
6
|
|
|
7
7
|
modules: ["@nuxt/ui"],
|
|
8
8
|
|
|
9
|
-
css: [fileURLToPath(new URL("./app/assets/css/
|
|
9
|
+
css: [fileURLToPath(new URL("./app/assets/css/nuxt-x-auth.css", import.meta.url))],
|
|
10
10
|
|
|
11
11
|
ui: {
|
|
12
12
|
colors: {
|
|
@@ -17,8 +17,11 @@ export default defineNuxtConfig({
|
|
|
17
17
|
|
|
18
18
|
runtimeConfig: {
|
|
19
19
|
public: {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
x: {
|
|
21
|
+
auth: {
|
|
22
|
+
baseUrl: "",
|
|
23
|
+
authPath: "/auth",
|
|
24
|
+
},
|
|
22
25
|
},
|
|
23
26
|
},
|
|
24
27
|
},
|
package/package.json
CHANGED
|
File without changes
|