重构认证授权模块,统一到 auth 包下
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user