"use server";
import { auth } from "@/auth";
export const signIn = async (email: string, password: string) => {
console.log("signing in...");
try {
const response = await auth.api.signInEmail({
body: {
email,
password,
},
asResponse: true, // returns a response object instead of data
});
console.log("response from sign in", response);
if (response.status === 200) {
return true;
} else {
return false;
}
} catch (APIError) {
console.error(APIError);
throw APIError;
}
};
"use server";
import { auth } from "@/auth";
export const signIn = async (email: string, password: string) => {
console.log("signing in...");
try {
const response = await auth.api.signInEmail({
body: {
email,
password,
},
asResponse: true, // returns a response object instead of data
});
console.log("response from sign in", response);
if (response.status === 200) {
return true;
} else {
return false;
}
} catch (APIError) {
console.error(APIError);
throw APIError;
}
};