MSP-8394 Simplify AuthDataByToken sql query

This commit is contained in:
Синельник Тимур Романович committed 2026-09-23 20:47:07 +03:00
1 parent 64d2c71ca2
commit f70a210b35
2 files changed
+1 -4

No files matched your search

-1
View File
@@ -13,7 +13,6 @@ type Token struct {
type AuthData struct {
AppName string
ApplicationGroupId int
AppId int
ExpireTime int
CreatedAt time.Time
+1 -3
View File
@@ -112,12 +112,10 @@ func (r Token) AuthDataByToken(ctx context.Context, token string) (*entity.AuthD
ctx = sql_metrics.OperationLabelToContext(ctx, "Token.AuthDataByToken")
q := `
SELECT application_group_id, app_id, application.name AS app_name , token.expire_time, token.created_at
SELECT app_id, application.name AS app_name , token.expire_time, token.created_at
FROM token
LEFT JOIN application
ON token.app_id = application.id
LEFT JOIN application_group
ON application.application_group_id = application_group.id
WHERE token = $1
`
result := entity.AuthData{}