Open platform to collect and prioritize feedback
enhancement: redirect instead of error (#466)
Guilherme Oenningc4dcee86d267
diff --git a/app/handlers/oauth.go b/app/handlers/oauth.goindex ea79956f4..92fe673ae 100644--- a/app/handlers/oauth.go+++ b/app/handlers/oauth.go@@ -38,7 +38,8 @@ func OAuthToken() web.HandlerFunc {identifier := c.QueryParam("identifier")cookie, err := c.Request.Cookie(web.CookieOAuthIdentifier)if err != nil {- return c.Failure(errors.Wrap(err, "failed to get oauth identifier cookie"))+ c.Logger().Warn(err.Error())+ return c.Redirect(redirectURL.String())}c.RemoveCookie(web.CookieOAuthIdentifier)diff --git a/app/pkg/web/request.go b/app/pkg/web/request.goindex 163d08d5e..8466422ec 100644--- a/app/pkg/web/request.go+++ b/app/pkg/web/request.go@@ -66,7 +66,11 @@ func (r *Request) SetHeader(key, value string) {// Cookie returns the named cookie provided in the request.func (r *Request) Cookie(name string) (*http.Cookie, error) {- return r.instance.Cookie(name)+ cookie, err := r.instance.Cookie(name)+ if err != nil {+ return nil, errors.Wrap(err, "failed to get '%s' cookie", name)+ }+ return cookie, nil}// AddCookie adds a cookie