diff --git a/routes.auth.go b/routes.auth.go index 0df506d..43421c1 100644 --- a/routes.auth.go +++ b/routes.auth.go @@ -97,6 +97,7 @@ func (s *server) handleLocal() http.HandlerFunc { secretBase64, err := jwt.DecodeSegment(jwtKey) // Declare the token with the algorithm used for signing, and the claims ts := jwt.NewWithClaims(jwt.SigningMethodHS512, claims) + at, err := ts.SignedString(secretBase64) // Create the JWT string if err != nil { @@ -249,11 +250,16 @@ func (s *server) handleRedirect() http.HandlerFunc { } } +func (s *server) handleRefreshToken() http.HandlerFunc { + return func(rw http.ResponseWriter, r *http.Request) { + } +} + func (s *server) handleJSONWebToken() http.HandlerFunc { return func(rw http.ResponseWriter, r *http.Request) { c := r.URL.Query().Get("model") - + //c, _ := mux.Vars(r)["model"] rw.Header().Set("Content-Type", "text/html") rw.WriteHeader(http.StatusOK) diff --git a/routes.go b/routes.go index 513e712..fbf41ab 100644 --- a/routes.go +++ b/routes.go @@ -6,5 +6,6 @@ func (s *server) routes() { s.router.HandleFunc("/local", s.handleLocal()).Methods("POST") s.router.HandleFunc("/oauth20", s.handleOAuth20()).Methods("POST") s.router.HandleFunc("/jwt", s.handleJSONWebToken()).Methods("GET") + s.router.HandleFunc("/oauth/refresh/{id}", s.handleRefreshToken()).Methods("POST") } diff --git a/templateOAuth/resultat.go b/templateOAuth/resultat.go index cac371a..81c0efe 100644 --- a/templateOAuth/resultat.go +++ b/templateOAuth/resultat.go @@ -16,9 +16,20 @@ var Resultat = ` @@ -30,7 +41,7 @@ var Resultat = ` content_copy - + refreshRefresh Token