mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat(cli): add polar as better-auth plugin (#578)
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { createAuthClient } from "better-auth/vue";
|
||||
|
||||
export default defineNuxtPlugin(nuxtApp => {
|
||||
const config = useRuntimeConfig()
|
||||
const serverUrl = config.public.serverURL
|
||||
|
||||
const authClient = createAuthClient({
|
||||
baseURL: serverUrl
|
||||
})
|
||||
|
||||
return {
|
||||
provide: {
|
||||
authClient: authClient
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,22 @@
|
||||
import { createAuthClient } from "better-auth/vue";
|
||||
{{#if (eq payments "polar")}}
|
||||
import { polarClient } from "@polar-sh/better-auth";
|
||||
{{/if}}
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
const config = useRuntimeConfig();
|
||||
const serverUrl = config.public.serverURL;
|
||||
|
||||
const authClient = createAuthClient({
|
||||
baseURL: serverUrl,
|
||||
{{#if (eq payments "polar")}}
|
||||
plugins: [polarClient()],
|
||||
{{/if}}
|
||||
});
|
||||
|
||||
return {
|
||||
provide: {
|
||||
authClient: authClient,
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user