We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 224ed8c commit cc275ceCopy full SHA for cc275ce
1 file changed
frontend/web/src/app/api/auth/[...nextauth]/route.ts
@@ -15,8 +15,6 @@ const getAllowedUsers = (): Set<string> => {
15
return users;
16
};
17
18
-const allowedUsers = getAllowedUsers();
19
-
20
type GoogleJWT = JWT & {
21
accessToken?: string;
22
refreshToken?: string;
@@ -143,6 +141,14 @@ export const authOptions: NextAuthOptions = {
143
141
callbacks: {
144
142
async signIn({ user }): Promise<boolean> {
145
const userEmail = user.email;
+ let allowedUsers: Set<string>;
+
146
+ try {
147
+ allowedUsers = getAllowedUsers();
148
+ } catch (error) {
149
+ console.error("NextAuth allowlist configuration error", error);
150
+ return false;
151
+ }
152
153
// Check if user is in allowlist
154
if (userEmail && allowedUsers.has(userEmail)) {
0 commit comments