Add gothic example code to internal/auth

This commit is contained in:
2024-07-20 06:56:45 -04:00
parent 6279037386
commit b4ba7f9736
2 changed files with 87 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package server
import (
"gothtest/internal/auth"
"encoding/json"
"log"
"fmt"
@@ -54,7 +55,7 @@ func (s *Server) getAuthCallbackFunc(w http.ResponseWriter, r *http.Request) {
provider := chi.URLParam(r, "provider")
r = r.WithContext(context.WithValue(context.Background(), "provider", provider))
user, err := gothic.CompleteUserAuth(w, r)
user, err := auth.CompleteAuthFlow(w, r)
if err != nil {
fmt.Fprintln(w, err)
return