fix: code challenge

This commit is contained in:
Livio Amstutz 2020-01-20 09:07:23 +01:00
parent 5d91ebfd62
commit c065f66d08
2 changed files with 8 additions and 5 deletions

View file

@ -18,7 +18,10 @@ type CodeChallenge struct {
Method CodeChallengeMethod
}
func (c *CodeChallenge) Verify(codeVerifier string) bool {
func VerifyCodeChallenge(c *CodeChallenge, codeVerifier string) bool {
if c == nil {
return false //TODO: ?
}
if c.Method == CodeChallengeMethodS256 {
codeVerifier = utils.HashString(sha256.New(), codeVerifier)
}