Allow Access Tokens with Required Login (#611)

هذا الالتزام موجود في:
Thomas Miceli
2026-02-02 19:31:07 +08:00
ملتزم من قبل GitHub
الأصل b7278b60ab
التزام b7dbdde66b
2 ملفات معدلة مع 90 إضافات و1 حذوفات

عرض الملف

@@ -206,6 +206,9 @@ func makeCheckRequireLogin(isSingleGistAccess bool) Middleware {
return next(ctx)
}
if getUserByToken(ctx) != nil {
return next(ctx)
}
allow, err := auth.ShouldAllowUnauthenticatedGistAccess(handlers.ContextAuthInfo{Context: ctx}, isSingleGistAccess)
if err != nil {
log.Fatal().Err(err).Msg("Failed to check if unauthenticated access is allowed")
@@ -354,7 +357,6 @@ func getUserByToken(ctx *context.Context) *db.User {
return nil
}
// Update last used timestamp
_ = accessToken.UpdateLastUsed()
return &accessToken.User