From 8e97b12b863dceddf6855f0d1aa2598edd3efe0b Mon Sep 17 00:00:00 2001 From: RobKraft Date: Sat, 21 Dec 2024 21:05:26 -0600 Subject: [PATCH] log profile --- auth.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/auth.go b/auth.go index 6a3bf37..1958c7d 100644 --- a/auth.go +++ b/auth.go @@ -58,7 +58,6 @@ func CallbackHandler(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusInternalServerError) return } - log.Println("callback handler") if r.URL.Query().Get("state") != session.Values["state"] { http.Error(w, "Invalid state parameter", http.StatusBadRequest) @@ -71,14 +70,13 @@ func CallbackHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusUnauthorized) return } - log.Printf("token found: %v", token) rawIDToken, ok := token.Extra("id_token").(string) if !ok { http.Error(w, "No id_token field in oauth2 token.", http.StatusInternalServerError) return } - log.Printf("id_token found: %v", rawIDToken) + oidcConfig := &oidc.Config{ ClientID: auth0ClientID, } @@ -89,7 +87,6 @@ func CallbackHandler(w http.ResponseWriter, r *http.Request) { http.Error(w, "Failed to verify ID Token: "+err.Error(), http.StatusInternalServerError) return } - log.Printf("id_token verified: %v", idToken) // Getting now the userInfo var profile map[string]interface{} @@ -107,6 +104,9 @@ func CallbackHandler(w http.ResponseWriter, r *http.Request) { return } + log.Printf("rawIDToken: %v", rawIDToken) + log.Printf("profile: %v", profile) + // Redirect to logged in page http.Redirect(w, r, "/", http.StatusSeeOther) }