diff --git a/tavern/internal/auth/oauth.go b/tavern/internal/auth/oauth.go index 0a6a05150..969457e29 100644 --- a/tavern/internal/auth/oauth.go +++ b/tavern/internal/auth/oauth.go @@ -151,6 +151,7 @@ func NewOAuthAuthorizationHandler(cfg oauth2.Config, pubKey ed25519.PublicKey, g Expires: time.Now().AddDate(0, 1, 0), }) log.Printf("[INFO] [OAuth] new login for user %q", usr.Name) + http.Redirect(w, req, "/", http.StatusFound) return } diff --git a/tavern/internal/auth/oauth_test.go b/tavern/internal/auth/oauth_test.go index 220fcd8cd..3149af540 100644 --- a/tavern/internal/auth/oauth_test.go +++ b/tavern/internal/auth/oauth_test.go @@ -152,7 +152,7 @@ func TestNewOAuthAuthorizationHandler(t *testing.T) { req = getOAuthAuthorizationRequest(t, privKey, expectedCode) handler.ServeHTTP(resp, req) result = resp.Result() - require.Equal(t, http.StatusOK, result.StatusCode) + require.Equal(t, http.StatusFound, result.StatusCode) // User assertions assert.Equal(t, 1, graph.User.Query().CountX(context.Background()))