add error handling logic
This commit is contained in:
@@ -29,6 +29,13 @@ func NewSQLiteTokenStore(db *gorm.DB) (*SQLiteTokenStore, error) {
|
||||
}
|
||||
|
||||
func (s *SQLiteTokenStore) revoke(tokenID string, expiresAt time.Time) error {
|
||||
if revoked, err := s.isRevoked(tokenID); err == nil {
|
||||
if revoked {
|
||||
return ErrTokenIsRevoked
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
return s.db.Create(&Token{
|
||||
TokenID: tokenID,
|
||||
Expiration: expiresAt,
|
||||
|
||||
Reference in New Issue
Block a user