Redirect aint perfect and username only
parent
7922043ef0
commit
40b65a4019
|
|
@ -30,8 +30,10 @@ func login(oauth2server *url.URL, w http.ResponseWriter, r *http.Request) error
|
||||||
url.Scheme = "http"
|
url.Scheme = "http"
|
||||||
}
|
}
|
||||||
cookie := &http.Cookie{
|
cookie := &http.Cookie{
|
||||||
Name: oauth2.REDIRECT,
|
Name: oauth2.REDIRECT,
|
||||||
Value: url.String(),
|
Value: url.String(),
|
||||||
|
SameSite: http.SameSiteLaxMode,
|
||||||
|
Path: "/authorize",
|
||||||
}
|
}
|
||||||
http.SetCookie(w, cookie)
|
http.SetCookie(w, cookie)
|
||||||
http.Redirect(w, r, oauth2server.String(), http.StatusSeeOther)
|
http.Redirect(w, r, oauth2server.String(), http.StatusSeeOther)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package server
|
||||||
import (
|
import (
|
||||||
"local/oauth2"
|
"local/oauth2"
|
||||||
"local/storage"
|
"local/storage"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
@ -31,6 +32,8 @@ func (s *Server) authorize(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
http.SetCookie(w, cookie)
|
http.SetCookie(w, cookie)
|
||||||
redirectCookie, err := r.Cookie(oauth2.REDIRECT)
|
redirectCookie, err := r.Cookie(oauth2.REDIRECT)
|
||||||
|
log.Printf("REDIR COOKIE", err, redirectCookie)
|
||||||
|
log.Println(r.Cookies())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue