Allow any user to log into demo

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-05 17:55:06 +01:00
parent d053273020
commit 50ee1db7a0

View file

@ -27,12 +27,14 @@ export const AuthOptions: NextAuthOptions = {
},
callbacks: {
async signIn({ user, account, profile, email, credentials }) {
// TODO: While we don't have a database with verified users, we will only allow hestia emails to sign in
if (user.email?.endsWith("@hestia.homes")) {
return true;
}
// TODO: While we don't have a database with verified users,
// for the demo, allow any user to sign in
// if (user.email?.endsWith("@hestia.homes")) {
// return true;
// }
// TODO: Handle this more elegantly
return "/beta";
// return "/beta";
return true;
},
async redirect({ baseUrl }) {
const redirectUrl = baseUrl + "/home";