Fix handling PKCE flag in the example client
Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com>
This commit is contained in:
parent
acfc8ad99b
commit
c2842f3356
1 changed files with 8 additions and 4 deletions
|
@ -34,11 +34,15 @@ func main() {
|
||||||
port := os.Getenv("PORT")
|
port := os.Getenv("PORT")
|
||||||
scopes := strings.Split(os.Getenv("SCOPES"), " ")
|
scopes := strings.Split(os.Getenv("SCOPES"), " ")
|
||||||
responseMode := os.Getenv("RESPONSE_MODE")
|
responseMode := os.Getenv("RESPONSE_MODE")
|
||||||
pkce, err := strconv.ParseBool(os.Getenv("PKCE"))
|
|
||||||
if err != nil {
|
|
||||||
logrus.Fatalf("error parsing PKCE %s", err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var pkce bool
|
||||||
|
if pkceEnv, ok := os.LookupEnv("PKCE"); ok {
|
||||||
|
var err error
|
||||||
|
pkce, err = strconv.ParseBool(pkceEnv)
|
||||||
|
if err != nil {
|
||||||
|
logrus.Fatalf("error parsing PKCE %s", err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
redirectURI := fmt.Sprintf("http://localhost:%v%v", port, callbackPath)
|
redirectURI := fmt.Sprintf("http://localhost:%v%v", port, callbackPath)
|
||||||
cookieHandler := httphelper.NewCookieHandler(key, key, httphelper.WithUnsecure())
|
cookieHandler := httphelper.NewCookieHandler(key, key, httphelper.WithUnsecure())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue