Skip to content

Commit

Permalink
Merge branch 'rarguelloF/fix-login-get' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondl committed Nov 5, 2018
2 parents 6c66376 + af3f34f commit cf24e25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func (a *Auth) Init(ab *authboss.Authboss) (err error) {

// LoginGet simply displays the login form
func (a *Auth) LoginGet(w http.ResponseWriter, r *http.Request) error {
var data authboss.HTMLData
data := authboss.HTMLData{}
if redir := r.URL.Query().Get(authboss.FormValueRedirect); len(redir) != 0 {
data = authboss.HTMLData{authboss.FormValueRedirect: redir}
data[authboss.FormValueRedirect] = redir
}
return a.Core.Responder.Respond(w, r, http.StatusOK, PageLogin, data)
}
Expand Down
2 changes: 1 addition & 1 deletion auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestAuthGet(t *testing.T) {

a := &Auth{ab}

r := mocks.Request("POST")
r := mocks.Request("GET")
r.URL.RawQuery = "redir=/redirectpage"
if err := a.LoginGet(nil, r); err != nil {
t.Error(err)
Expand Down

0 comments on commit cf24e25

Please sign in to comment.