diff --git a/jwt.go b/jwt.go index 72002c5..89eafb6 100644 --- a/jwt.go +++ b/jwt.go @@ -15,6 +15,8 @@ import ( const ( AccessType = "access" RefreshType = "refresh" + + TFAStep = "tfa" ) func CreateRefreshTokenByAccess(accessClaims JWT, ttl time.Duration) JWT { @@ -75,8 +77,8 @@ func (j *JWT) WithAuthorizationInfo(tai TokenAuthorizationInfo, secret string) * return j } -func (j *JWT) WithTFAStep(tai TokenAuthorizationInfo, secret string) *JWT { - j.Step = "tfa" +func (j *JWT) WithTFAStep() *JWT { + j.Step = TFAStep return j } @@ -94,7 +96,7 @@ func (j *JWT) IsRefreshToken() bool { } func (j *JWT) IsTFAStep() bool { - return j.Step == "tfa" + return j.Step == TFAStep } func (j *JWT) CheckAccess() bool {