Copilot commented on code in PR #3736:
URL: https://github.com/apache/texera/pull/3736#discussion_r2350099187


##########
core/gui/src/app/dashboard/component/admin/user/admin-user.component.ts:
##########
@@ -196,6 +196,10 @@ export class AdminUserComponent implements OnInit {
     return Date.now() - lastMs < active_window;
   }
 
+  getAccountCreation(user: User): number {

Review Comment:
   This method lacks documentation explaining why the multiplication by 1000 is 
necessary. Add a comment explaining that this converts from Unix timestamp in 
seconds to milliseconds for JavaScript Date objects.
   ```suggestion
     getAccountCreation(user: User): number {
       // Convert Unix timestamp in seconds to milliseconds for JavaScript Date 
objects
   ```



##########
core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserAuthenticator.scala:
##########
@@ -40,7 +41,8 @@ object UserAuthenticator extends Authenticator[JwtContext, 
SessionUser] with Laz
         
UserRoleEnum.valueOf(context.getJwtClaims.getClaimValue("role").asInstanceOf[String])
       val googleId = 
context.getJwtClaims.getClaimValue("googleId").asInstanceOf[String]
       val comment = 
context.getJwtClaims.getClaimValue("comment").asInstanceOf[String]
-      val user = new User(userId, userName, email, null, googleId, null, role, 
comment)
+      val accountCreation = 
context.getJwtClaims.getClaimValue("accountCreation").asInstanceOf[OffsetDateTime]

Review Comment:
   This cast to OffsetDateTime will fail if the JWT claim contains a different 
type (likely a string or number). Add proper type checking and conversion from 
the actual claim type to OffsetDateTime.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to