@@ -28,7 +28,7 @@ export function createGoogleOAuth2Client(options: GoogleOAuthOptions, callbackUr
2828 */
2929export function getGoogleAuthUrl ( oauth2Client : OAuth2Client , options : GoogleOAuthOptions ) : string {
3030 const scopes = options . scopes || [ 'openid' , 'profile' , 'email' ]
31-
31+
3232 return oauth2Client . generateAuthUrl ( {
3333 access_type : 'offline' ,
3434 scope : scopes ,
@@ -82,7 +82,7 @@ export async function generateSecurePassword(): Promise<string> {
8282 * Find or create user from Google OAuth data
8383 */
8484export async function findOrCreateGoogleUser (
85- googleUser : GoogleUserInfo ,
85+ googleUser : GoogleUserInfo ,
8686 moduleOptions : ModuleOptions
8787) : Promise < User | null > {
8888 const db = await useDb ( moduleOptions )
@@ -97,7 +97,7 @@ export async function findOrCreateGoogleUser(
9797
9898 if ( userResult . rows . length > 0 ) {
9999 const user = userResult . rows [ 0 ]
100-
100+
101101 // Update profile picture if it has changed
102102 if ( user . profile_picture !== googleUser . picture ) {
103103 await db . sql `
@@ -107,7 +107,7 @@ export async function findOrCreateGoogleUser(
107107 `
108108 user . profile_picture = googleUser . picture
109109 }
110-
110+
111111 return user
112112 }
113113
@@ -127,7 +127,7 @@ export async function findOrCreateGoogleUser(
127127 updated_at = CURRENT_TIMESTAMP
128128 WHERE id = ${ user . id }
129129 `
130-
130+
131131 user . google_id = googleUser . id
132132 user . profile_picture = googleUser . picture
133133 return user
@@ -140,8 +140,8 @@ export async function findOrCreateGoogleUser(
140140
141141 // Create new user
142142 const securePassword = await generateSecurePassword ( )
143-
144- const insertResult = await db . sql `
143+
144+ await db . sql `
145145 INSERT INTO {${ usersTable } } (
146146 email, name, password, role, google_id, profile_picture,
147147 active, created_at, updated_at
@@ -171,13 +171,13 @@ export async function findOrCreateGoogleUser(
171171 * Create authentication token for user (reusing existing logic)
172172 */
173173export async function createAuthTokenForUser (
174- user : User ,
174+ user : User ,
175175 moduleOptions : ModuleOptions ,
176176 rememberMe = false
177177) : Promise < string > {
178178 const db = await useDb ( moduleOptions )
179179 const personalAccessTokensTable = moduleOptions . tables . personalAccessTokens
180-
180+
181181 const token = crypto . randomBytes ( 64 ) . toString ( 'hex' )
182182 const tokenName = 'oauth_auth_token'
183183
@@ -186,7 +186,8 @@ export async function createAuthTokenForUser(
186186 if ( rememberMe ) {
187187 const longTermDays = moduleOptions . auth . rememberMeExpiration || 30
188188 expiresAt . setDate ( expiresAt . getDate ( ) + longTermDays )
189- } else {
189+ }
190+ else {
190191 expiresAt . setMinutes ( expiresAt . getMinutes ( ) + moduleOptions . auth . tokenExpiration )
191192 }
192193
@@ -206,4 +207,4 @@ export async function createAuthTokenForUser(
206207 `
207208
208209 return token
209- }
210+ }
0 commit comments