Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
DrOctavius committed May 22, 2024
1 parent ce296b7 commit 2d3aa0d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions token.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func VerifyToken(realToken, sentToken string) bool {

}

// VerifyToken verifies the sent token equals the real one
// VerifyTokenDebug verifies the sent token equals the real one
// and returns a bool value indicating if tokens are equal.
// Supports masked tokens. realToken comes from Token(r) and
// sentToken is token sent unusual way.
Expand All @@ -111,21 +111,21 @@ func VerifyTokenDebug(realToken, sentToken string) bool {
}
log.Println("decoded realToken", realToken, err)

if len(r) == 2*tokenLength {
r = unmaskToken(r)
log.Println("unmasked realToken", r)
}
//if len(r) == 2*tokenLength {
r = unmaskToken(r)
log.Println("unmasked realToken", r)
//}
//s, err := base64.StdEncoding.DecodeString(sentToken)
s, err := decodeFromBase62(sentToken)
if err != nil {
return false
}
log.Println("decoded sentToken", sentToken, err)

if len(s) == 2*tokenLength {
s = unmaskToken(s)
log.Println("unmasked sentToken", s)
}
//if len(s) == 2*tokenLength {
s = unmaskToken(s)
log.Println("unmasked sentToken", s)
//}
return tokensEqual(r, s)

}
Expand Down

0 comments on commit 2d3aa0d

Please sign in to comment.