Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrResetTokenInvalid = errors.New("invalid or expired reset token")
)
Functions ¶
Types ¶
type Claims ¶
type Claims struct {
UserID string `json:"uid"`
TokenType string `json:"typ"`
jwt.RegisteredClaims
}
type RefreshStore ¶
type RefreshStore interface {
SaveRefresh(ctx context.Context, jti, userID, token string, expiresAt time.Time, rotatedFrom *string) error
IsValid(ctx context.Context, jti, token string) (bool, string, time.Time, error)
Revoke(ctx context.Context, jti string) error
RevokeAllForUser(ctx context.Context, userID string) error
}
func NewRefreshStore ¶
func NewRefreshStore(db *sql.DB, q *repo.Queries) RefreshStore
type ResetStore ¶
type ResetStore interface {
CreateResetToken(userID string) (plainToken string, err error)
ValidateAndConsume(token string) (userID string, err error)
}
func NewResetStore ¶
func NewResetStore(q *repo.Queries) ResetStore
Click to show internal directories.
Click to hide internal directories.