@@ -122,7 +122,7 @@ async function handleAuthorizationCode(body: Record<string, string>) {
122122 }
123123
124124 // Check if code was already used
125- if ( authCode . used_at ) {
125+ if ( authCode . used ) {
126126 return tokenError ( 'invalid_grant' , 'Authorization code has already been used' ) ;
127127 }
128128
@@ -168,18 +168,18 @@ async function handleAuthorizationCode(body: Record<string, string>) {
168168 // Mark code as used
169169 await supabase
170170 . from ( 'oauth_authorization_codes' )
171- . update ( { used_at : new Date ( ) . toISOString ( ) } )
171+ . update ( { used : true } )
172172 . eq ( 'id' , authCode . id ) ;
173173
174174 // Get user info for token claims
175175 const { data : merchant } = await supabase
176176 . from ( 'merchants' )
177- . select ( 'id, email, name, email_verified ' )
177+ . select ( 'id, email, name' )
178178 . eq ( 'id' , authCode . user_id )
179179 . single ( ) ;
180180
181181 const user = merchant
182- ? { ...merchant , email_verified : merchant . email_verified ?? false }
182+ ? { ...merchant , email_verified : true }
183183 : { id : authCode . user_id , email : undefined , name : undefined , email_verified : false } ;
184184
185185 const client = { client_id } ;
@@ -249,7 +249,7 @@ async function handleRefreshToken(body: Record<string, string>) {
249249 return tokenError ( 'invalid_grant' , 'Invalid refresh token' ) ;
250250 }
251251
252- if ( storedToken . revoked_at ) {
252+ if ( storedToken . revoked ) {
253253 return tokenError ( 'invalid_grant' , 'Refresh token has been revoked' ) ;
254254 }
255255
@@ -260,7 +260,7 @@ async function handleRefreshToken(body: Record<string, string>) {
260260 // Revoke old refresh token
261261 await supabase
262262 . from ( 'oauth_refresh_tokens' )
263- . update ( { revoked_at : new Date ( ) . toISOString ( ) } )
263+ . update ( { revoked : true } )
264264 . eq ( 'id' , storedToken . id ) ;
265265
266266 // Get user info
0 commit comments