feat(auth): support multiple user roles in JWT and services

- Change JWT access token RoleID claim from int to []int to support multiple roles per user
- Update all token generation and refresh logic to handle multiple role IDs as []int
- Refactor services to return and process multiple role IDs from user_roles table
- Fix OAuth state handling explanation and improve code comments
- Clean up related function signatures and usages for consistency
This commit is contained in:
2026-02-03 16:35:08 +08:00
parent f4b8651a5c
commit fee314870d
5 changed files with 48 additions and 65 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ func validateSessionFromDB(sessionID string) (*models.JWTSession, error) {
WHERE id = ? AND is_revoked = false
`, sessionID).Scan(
&session.ID,
&session.UserID,
&session.UsersID,
&session.RefreshTokenHash,
&session.UserAgent,
&session.IPAddress,