[socialmon] auth: allow all @greatfrontend domain emails to login (#1430)
This commit is contained in:
parent
13d5058703
commit
89b3981632
|
|
@ -2,17 +2,10 @@ import type { GetServerSidePropsContext } from 'next';
|
|||
import { getServerSession, type NextAuthOptions } from 'next-auth';
|
||||
import GoogleProvider from 'next-auth/providers/google';
|
||||
|
||||
import type { PrismaClient } from '~/../prisma/generated/client';
|
||||
import prisma from '~/server/prisma';
|
||||
|
||||
import { PrismaAdapter } from '@next-auth/prisma-adapter';
|
||||
import type { PrismaClient } from '@prisma/client';
|
||||
|
||||
export const AUTHORIZED_EMAILS = [
|
||||
'yangshun@greatfrontend.com',
|
||||
'gina@greatfrontend.com',
|
||||
'nitesh@greatfrontend.com',
|
||||
'nikki@greatfrontend.com',
|
||||
];
|
||||
|
||||
const ADMIN_EMAILS = ['yangshun@greatfrontend.com', 'gina@greatfrontend.com'];
|
||||
|
||||
|
|
@ -30,7 +23,7 @@ export const authConfig: NextAuthOptions = {
|
|||
return session;
|
||||
},
|
||||
async signIn({ profile }) {
|
||||
if (AUTHORIZED_EMAILS.includes(profile?.email ?? '')) {
|
||||
if ((profile?.email ?? '').includes('@greatfrontend.com')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue