Skip to content

Commit 05fe641

Browse files
ci: apply automated fixes
1 parent e28d8b2 commit 05fe641

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

src/auth/auth.server.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ export class AuthService implements IAuthService {
9797
/**
9898
* Map database user to AuthUser type
9999
*/
100-
private mapDbUserToAuthUser(user: DbUser, capabilities: Capability[]): AuthUser {
100+
private mapDbUserToAuthUser(
101+
user: DbUser,
102+
capabilities: Capability[],
103+
): AuthUser {
101104
return {
102105
userId: user.id,
103106
email: user.email,
@@ -140,7 +143,8 @@ export async function requireCapability(
140143
const user = await requireAuthentication(authService, request)
141144

142145
const hasAccess =
143-
user.capabilities.includes('admin') || user.capabilities.includes(capability)
146+
user.capabilities.includes('admin') ||
147+
user.capabilities.includes(capability)
144148

145149
if (!hasAccess) {
146150
throw new AuthError(

src/auth/context.server.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ import {
2222
// ============================================================================
2323

2424
function getSessionSecret(): string {
25-
return (
26-
process.env.SESSION_SECRET || 'dev-secret-key-change-in-production'
27-
)
25+
return process.env.SESSION_SECRET || 'dev-secret-key-change-in-production'
2826
}
2927

3028
function isProduction(): boolean {

src/auth/oauth.server.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,7 @@ export async function exchangeGitHubCode(
243243
console.error(
244244
'[OAuth] GitHub token exchange succeeded but no access_token returned',
245245
)
246-
throw new AuthError(
247-
'No access token received from GitHub',
248-
'OAUTH_ERROR',
249-
)
246+
throw new AuthError('No access token received from GitHub', 'OAUTH_ERROR')
250247
}
251248

252249
return tokenData.access_token

src/auth/repositories.server.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ export class DrizzleCapabilitiesRepository implements ICapabilitiesRepository {
180180
}
181181

182182
// Extract user capabilities (same for all rows)
183-
const directCapabilities = (result[0]?.userCapabilities || []) as Capability[]
183+
const directCapabilities = (result[0]?.userCapabilities ||
184+
[]) as Capability[]
184185

185186
// Collect all role capabilities from all rows
186187
const roleCapabilities = result
@@ -226,7 +227,8 @@ export class DrizzleCapabilitiesRepository implements ICapabilitiesRepository {
226227

227228
// Store direct capabilities (same for all rows of the same user)
228229
if (!userCapabilitiesMap[userId]) {
229-
userCapabilitiesMap[userId] = (row.userCapabilities || []) as Capability[]
230+
userCapabilitiesMap[userId] = (row.userCapabilities ||
231+
[]) as Capability[]
230232
}
231233

232234
// Collect role capabilities

src/utils/oauth.server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
*/
99

1010
import { getOAuthService, getOAuthAccountRepository } from '~/auth/index.server'
11-
import type { OAuthProvider, OAuthProfile, OAuthResult } from '~/auth/index.server'
11+
import type {
12+
OAuthProvider,
13+
OAuthProfile,
14+
OAuthResult,
15+
} from '~/auth/index.server'
1216

1317
// Re-export types for backward compatibility
1418
export type { OAuthProvider, OAuthProfile }

0 commit comments

Comments
 (0)