feat: support double token

This commit is contained in:
weloe
2023-11-01 04:08:05 +08:00
parent 8a6c8eba30
commit 3c7a8ef8b6
10 changed files with 332 additions and 22 deletions

View File

@@ -45,6 +45,11 @@ type IEnforcer interface {
GetIdByToken(token string) string
GetLoginCount(id string, device ...string) int
// refresh api
GetRefreshToken(tokenValue string) string
RefreshToken(refreshToken string, refreshModel ...*model.Refresh) (*model.RefreshRes, error)
RefreshTokenByModel(refreshToken string, refreshModel *model.Refresh, ctx ctx.Context) (*model.RefreshRes, error)
GetLoginCounts() (int, error)
GetLoginTokenCounts() (int, error)