From 6ae5028a05ef19f60862e7bfbfc060f831620bb2 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 17 Jun 2017 23:43:57 +0200 Subject: [PATCH] Better error messages --- auth/google.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/google.go b/auth/google.go index 9c9c589e..7cae086d 100644 --- a/auth/google.go +++ b/auth/google.go @@ -51,13 +51,13 @@ func InstallGoogleAuth(app *aero.Application) { // Auth Callback app.Get("/auth/google/callback", func(ctx *aero.Context) string { if !ctx.HasSession() { - return ctx.Error(http.StatusUnauthorized, "Session does not exist", errors.New("Google login failed: Session does not exist")) + return ctx.Error(http.StatusUnauthorized, "Google login failed", errors.New("Session does not exist")) } session := ctx.Session() if session.ID() != ctx.Query("state") { - return ctx.Error(http.StatusUnauthorized, "Authorization not allowed for this session", errors.New("Google login failed: Incorrect state")) + return ctx.Error(http.StatusUnauthorized, "Google login failed", errors.New("Incorrect state")) } // Handle the exchange code to initiate a transport