重构认证授权模块,统一到 auth 包下

This commit is contained in:
2025-12-29 10:18:01 +08:00
parent bf8f001a30
commit 1262a8dae4
8 changed files with 407 additions and 269 deletions

View File

@@ -29,8 +29,8 @@ func FindSessionByRefresh(refreshToken string, now time.Time) (*m.Session, error
).First()
}
func SaveSession(session *m.Session) error {
return q.Session.Save(session)
func SaveSession(tx *q.Query, session *m.Session) error {
return tx.Session.Save(session)
}
func RemoveSession(ctx context.Context, accessToken string, refreshToken string) error {