add recipe viewer
This commit is contained in:
parent
92b11f7b9d
commit
f7f1535695
31 changed files with 1532 additions and 151 deletions
|
|
@ -193,12 +193,19 @@ func (ar *AuthRouter) Route(r chi.Router) {
|
|||
json.NewEncoder(w).Encode(value)
|
||||
})
|
||||
|
||||
r.Post("/refresh", func(w http.ResponseWriter, r *http.Request) {
|
||||
r.Get("/refresh", func(w http.ResponseWriter, r *http.Request) {
|
||||
refreshToken := r.Header.Get("X-Refresh-Token")
|
||||
|
||||
if refreshToken == "" {
|
||||
http.Error(w, "Refresh token not found", http.StatusUnauthorized)
|
||||
return
|
||||
cookie, err := r.Cookie("refresh_token")
|
||||
|
||||
if err != nil {
|
||||
|
||||
http.Error(w, "Refresh token not found", http.StatusUnauthorized)
|
||||
return
|
||||
} else {
|
||||
refreshToken = cookie.Value
|
||||
}
|
||||
}
|
||||
|
||||
// exchange refresh token for new token
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue