// Check determines whether the provided token is correct and non-expired
// or not.
Check determines whether the provided token is correct and non-expired
or not.
// Check determines whether the provided token is correct and non - expired // or not .
func (t *Token) Check(v string) error {
	if timeutil.Now().After(t.ExpiresAt.Time) {
		return ErrInvalidToken
	}
	if len(t.Hash) == 0 {
		return ErrInvalidToken
	}
	if bcrypt.CompareHashAndPassword(t.Hash, []byte(v)) != nil {
		return ErrInvalidToken
	}
	return nil
}
func ( t * Token ) Check ( v string ) error { if timeutil . Now ( ) . After ( t . ExpiresAt . Time ) { return ErrInvalidToken } if len ( t . Hash ) == 0 { return ErrInvalidToken } if bcrypt . CompareHashAndPassword ( t . Hash , [ ] byte ( v ) ) != nil { return ErrInvalidToken } return nil }
Check determines whether the provided token is correct and non-expired
or not.
Check determines whether the provided token is correct and non - expired or not .