Update oauthproxy.go
Co-authored-by: Jan Larwig <jan@larwig.com> Signed-off-by: Callum Newton <callum.newton@wayve.ai>
This commit is contained in:
parent
3b2f1d4761
commit
fb3fe419d7
|
|
@ -1250,12 +1250,11 @@ func checkAllowedEmails(req *http.Request, s *sessionsapi.SessionState) bool {
|
||||||
// encodeState builds the OAuth state param out of our nonce and
|
// encodeState builds the OAuth state param out of our nonce and
|
||||||
// original application redirect
|
// original application redirect
|
||||||
func encodeState(nonce string, redirect string, encode bool) string {
|
func encodeState(nonce string, redirect string, encode bool) string {
|
||||||
redirectPart := redirect
|
|
||||||
if !encode {
|
if !encode {
|
||||||
redirectPart = url.QueryEscape(redirectPart)
|
redirect = url.QueryEscape(redirect)
|
||||||
}
|
}
|
||||||
|
|
||||||
rawString := fmt.Sprintf("%v:%v", nonce, redirectPart)
|
rawString := fmt.Sprintf("%v:%v", nonce, redirect)
|
||||||
if encode {
|
if encode {
|
||||||
return base64.RawURLEncoding.EncodeToString([]byte(rawString))
|
return base64.RawURLEncoding.EncodeToString([]byte(rawString))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue