Skip to content

Commit

Permalink
Disabled refresh tokes as they currently don't work correctly
Browse files Browse the repository at this point in the history
See #1
  • Loading branch information
StiviiK committed Jun 3, 2020
1 parent 530ad44 commit 0b088eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 0 additions & 6 deletions ideas.txt

This file was deleted.

6 changes: 3 additions & 3 deletions pkg/httphandler/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func (root *HttpHandler) callbackHandler(w http.ResponseWriter, r *http.Request,
http.SetCookie(w, root.forwardAuth.ClearCSRFCookie(root.options))

http.SetCookie(w, root.forwardAuth.MakeAuthCookie(root.options, authResult))
if len(authResult.RefreshToken) > 0 { // Do we have an refresh token?
http.SetCookie(w, root.forwardAuth.MakeRefreshAuthCookie(root.options, authResult))
}
//if len(authResult.RefreshToken) > 0 { // Do we have an refresh token?
// http.SetCookie(w, root.forwardAuth.MakeRefreshAuthCookie(root.options, authResult))
//}
http.Redirect(w, r, redirect, http.StatusTemporaryRedirect)
}
4 changes: 2 additions & 2 deletions pkg/httphandler/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ func (root *HttpHandler) rootHandler(w http.ResponseWriter, r *http.Request, for
logger.Warn("IsAuthenticated failed, initating login flow.")

http.SetCookie(w, root.forwardAuth.ClearAuthCookie(root.options))
http.SetCookie(w, root.forwardAuth.ClearRefreshAuthCookie(root.options))
//http.SetCookie(w, root.forwardAuth.ClearRefreshAuthCookie(root.options))

state := uuid.New().String()
http.SetCookie(w, root.forwardAuth.MakeCSRFCookie(w, r, root.options, state))
http.Redirect(w, r, root.forwardAuth.OAuth2Config.AuthCodeURL(state), http.StatusTemporaryRedirect)
//http.Redirect(w, r, root.forwardAuth.OAuth2Config.AuthCodeURL(state), http.StatusTemporaryRedirect)
return
}

Expand Down

0 comments on commit 0b088eb

Please sign in to comment.