feat(api): support list/revoke auth token in admin/current user api

This commit is contained in:
Marcus Efraimsson
2019-03-08 15:15:38 +01:00
parent 8029e48588
commit 0cd5a6772d
8 changed files with 600 additions and 8 deletions
+7 -1
View File
@@ -1,6 +1,8 @@
package models
import "errors"
import (
"errors"
)
// Typed errors
var (
@@ -23,6 +25,10 @@ type UserToken struct {
UnhashedToken string
}
type RevokeAuthTokenCmd struct {
AuthTokenId int64 `json:"authTokenId"`
}
// UserTokenService are used for generating and validating user tokens
type UserTokenService interface {
CreateToken(userId int64, clientIP, userAgent string) (*UserToken, error)