fix(auth): drop nonexistent account_blocked column from login lookup
getLoginUser selected users.account_blocked, which does not exist in the DB (nor the Drizzle schema). Every credentials authorize() call threw a SQL error -> NextAuth CallbackRouteError -> 'error=Configuration', so no login could ever succeed. Remove the phantom column from the query and LoginUser interface. Also fix all remaining biome noNonNullAssertion / noExplicitAny lint warnings so CI's check job (biome:lint) passes and the push deploy runs.
This commit is contained in:
1 parent
8275842e78
commit
22d455da7a
13 files changed
+71
-65
No files matched your search
+1
-6
@@ -21,7 +21,6 @@ interface LoginUser {
|
||||
mailVerified: string | null;
|
||||
twoFactorConfirmedAt: string | null;
|
||||
twoFactorSecret: string | null;
|
||||
accountBlocked: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,13 +40,11 @@ async function getLoginUser(username: string): Promise<LoginUser | null> {
|
||||
mail_verified: string | null;
|
||||
two_factor_confirmed_at: string | null;
|
||||
two_factor_secret: string | null;
|
||||
account_blocked: string | null;
|
||||
}>(sql`
|
||||
SELECT id, username, password, rank, mail,
|
||||
mail_verified,
|
||||
two_factor_confirmed_at,
|
||||
two_factor_secret,
|
||||
account_blocked
|
||||
two_factor_secret
|
||||
FROM users
|
||||
WHERE username = ${username}
|
||||
LIMIT 1
|
||||
@@ -61,7 +58,6 @@ async function getLoginUser(username: string): Promise<LoginUser | null> {
|
||||
mail_verified: string | null;
|
||||
two_factor_confirmed_at: string | null;
|
||||
two_factor_secret: string | null;
|
||||
account_blocked: string | null;
|
||||
}>;
|
||||
return rows.length > 0
|
||||
? {
|
||||
@@ -73,7 +69,6 @@ async function getLoginUser(username: string): Promise<LoginUser | null> {
|
||||
mailVerified: rows[0].mail_verified,
|
||||
twoFactorConfirmedAt: rows[0].two_factor_confirmed_at,
|
||||
twoFactorSecret: rows[0].two_factor_secret,
|
||||
accountBlocked: rows[0].account_blocked,
|
||||
}
|
||||
: null;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user