mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
API: Refactor "GET /api/v1/config" endpoint for JWT sessions #5230
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -112,6 +112,18 @@ func authAnyJWT(c *gin.Context, clientIP, authToken string, resource acl.Resourc
|
||||
IssuedAt: issuedAt,
|
||||
NotBefore: notBefore,
|
||||
ExpiresAt: expiresAt,
|
||||
PreviewToken: func() string {
|
||||
if tokenScopes.Contains(acl.ResourceFiles.String()) {
|
||||
return conf.PreviewToken()
|
||||
}
|
||||
return ""
|
||||
}(),
|
||||
DownloadToken: func() string {
|
||||
if tokenScopes.Contains(acl.ResourceFiles.String()) {
|
||||
return conf.DownloadToken()
|
||||
}
|
||||
return ""
|
||||
}(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user