mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-08 12:27:44 +00:00
chore: lint
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
import { createAuthClient } from "better-auth/vue";
|
import { createAuthClient } from "better-auth/vue";
|
||||||
|
|
||||||
export const client = createAuthClient({
|
export const client = createAuthClient({
|
||||||
baseURL: "http://localhost:3000",
|
baseURL: "http://localhost:3000",
|
||||||
});
|
});
|
||||||
|
|
||||||
export const {
|
export const {
|
||||||
signIn,
|
signIn,
|
||||||
signOut,
|
signOut,
|
||||||
signUp,
|
signUp,
|
||||||
useSession,
|
useSession,
|
||||||
forgetPassword,
|
forgetPassword,
|
||||||
resetPassword,
|
resetPassword,
|
||||||
} = client;
|
} = client;
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import { betterAuth } from "better-auth";
|
import { betterAuth } from "better-auth";
|
||||||
|
|
||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
database: {
|
database: {
|
||||||
provider: "sqlite",
|
provider: "sqlite",
|
||||||
url: "./sqlite.db",
|
url: "./sqlite.db",
|
||||||
},
|
},
|
||||||
socialProviders: {
|
socialProviders: {
|
||||||
google: {
|
google: {
|
||||||
clientId: process.env.GOOGLE_CLIENT_ID || "",
|
clientId: process.env.GOOGLE_CLIENT_ID || "",
|
||||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "",
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emailAndPassword: {
|
emailAndPassword: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
async sendResetPassword(url, user) {
|
async sendResetPassword(url, user) {
|
||||||
console.log("Reset password url:", url);
|
console.log("Reset password url:", url);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { forgetPassword } from "~/lib/auth-client.js"
|
import { forgetPassword } from "~/lib/auth-client.js";
|
||||||
|
|
||||||
const email = ref("")
|
const email = ref("");
|
||||||
|
|
||||||
const handleForgetPassword = async () => {
|
const handleForgetPassword = async () => {
|
||||||
if (!email.value) {
|
if (!email.value) {
|
||||||
@@ -22,9 +22,9 @@ const handleForgetPassword = async () => {
|
|||||||
onError(context) {
|
onError(context) {
|
||||||
alert(context.error.message);
|
alert(context.error.message);
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ definePageMeta({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const features = [
|
const features = [
|
||||||
"Email & Password",
|
"Email & Password",
|
||||||
"Organization | Teams",
|
"Organization | Teams",
|
||||||
"Passkeys",
|
"Passkeys",
|
||||||
"Multi Factor",
|
"Multi Factor",
|
||||||
"Password Reset",
|
"Password Reset",
|
||||||
"Email Verification",
|
"Email Verification",
|
||||||
"Roles & Permissions",
|
"Roles & Permissions",
|
||||||
"Rate Limiting",
|
"Rate Limiting",
|
||||||
"Session Management",
|
"Session Management",
|
||||||
];
|
];
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const handleResetPassword = async () => {
|
|||||||
alert("Please enter same passwords");
|
alert("Please enter same passwords");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await resetPassword({
|
await resetPassword({
|
||||||
newPassword: password.value,
|
newPassword: password.value,
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
@@ -20,8 +20,8 @@ const handleResetPassword = async () => {
|
|||||||
alert(context.error.message);
|
alert(context.error.message);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import { signIn } from "~/lib/auth-client.js";
|
|||||||
const email = ref("");
|
const email = ref("");
|
||||||
const password = ref("");
|
const password = ref("");
|
||||||
|
|
||||||
const handleSignIn = async() => {
|
const handleSignIn = async () => {
|
||||||
await signIn.email(
|
await signIn.email(
|
||||||
{
|
{
|
||||||
email: email.value,
|
email: email.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
@@ -27,9 +27,7 @@ const handleSignIn = async() => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { signUp } from "~/lib/auth-client.js"
|
import { signUp } from "~/lib/auth-client.js";
|
||||||
|
|
||||||
const firstName = ref("")
|
const firstName = ref("");
|
||||||
const lastName = ref("")
|
const lastName = ref("");
|
||||||
const email = ref("")
|
const email = ref("");
|
||||||
const password = ref("")
|
const password = ref("");
|
||||||
|
|
||||||
const handleSignUp = async () => {
|
const handleSignUp = async () => {
|
||||||
const user = {
|
const user = {
|
||||||
@@ -21,10 +21,10 @@ const handleSignUp = async () => {
|
|||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
onError(context) {
|
onError(context) {
|
||||||
alert(context.error.message);
|
alert(context.error.message);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user