make dev setup better (#116)
* make dev setup better * chage docs * remove the need of github login
This commit is contained in:
@@ -44,13 +44,17 @@ declare module "next-auth" {
|
||||
* Auth providers
|
||||
*/
|
||||
|
||||
const providers: Provider[] = [
|
||||
GitHubProvider({
|
||||
clientId: env.GITHUB_ID,
|
||||
clientSecret: env.GITHUB_SECRET,
|
||||
allowDangerousEmailAccountLinking: true,
|
||||
}),
|
||||
];
|
||||
const providers: Provider[] = [];
|
||||
|
||||
if (env.GITHUB_ID && env.GITHUB_SECRET) {
|
||||
providers.push(
|
||||
GitHubProvider({
|
||||
clientId: env.GITHUB_ID,
|
||||
clientSecret: env.GITHUB_SECRET,
|
||||
allowDangerousEmailAccountLinking: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (env.GOOGLE_CLIENT_ID && env.GOOGLE_CLIENT_SECRET) {
|
||||
providers.push(
|
||||
@@ -76,6 +80,10 @@ if (env.FROM_EMAIL) {
|
||||
);
|
||||
}
|
||||
|
||||
if (providers.length === 0) {
|
||||
throw new Error("No auth providers found, need atleast one");
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for NextAuth.js used to configure adapters, providers, callbacks, etc.
|
||||
*
|
||||
@@ -100,7 +108,7 @@ export const authOptions: NextAuthOptions = {
|
||||
events: {
|
||||
createUser: async ({ user }) => {
|
||||
// No waitlist for self hosting
|
||||
if (!env.NEXT_PUBLIC_IS_CLOUD) {
|
||||
if (!env.NEXT_PUBLIC_IS_CLOUD || env.NODE_ENV === "development") {
|
||||
await db.user.update({
|
||||
where: { id: user.id },
|
||||
data: { isBetaUser: true },
|
||||
|
Reference in New Issue
Block a user