Skip to content
Snippets Groups Projects
Unverified Commit 350018c3 authored by Paul Rosenzweig's avatar Paul Rosenzweig Committed by GitHub
Browse files

remove old workaround that broke login redirect with hash (#12425)

parent e31ad3db
Branches
Tags
No related merge requests found
......@@ -23,7 +23,6 @@ export const login = createThunkAction(
await SessionApi.create(credentials);
MetabaseAnalytics.trackEvent("Auth", "Login");
// TODO: redirect after login (carry user to intended destination)
await Promise.all([
dispatch(refreshCurrentUser()),
dispatch(refreshSiteSettings()),
......@@ -47,7 +46,6 @@ export const loginGoogle = createThunkAction(LOGIN_GOOGLE, function(
MetabaseAnalytics.trackEvent("Auth", "Google Auth Login");
// TODO: redirect after login (carry user to intended destination)
await Promise.all([
dispatch(refreshCurrentUser()),
dispatch(refreshSiteSettings()),
......
......@@ -104,16 +104,7 @@ const UserIsAuthenticated = UserAuthWrapper({
failureRedirectPath: "/auth/login",
authSelector: state => state.currentUser,
wrapperDisplayName: "UserIsAuthenticated",
redirectAction: location =>
// HACK: workaround for redux-auth-wrapper not including hash
// https://github.com/mjrussell/redux-auth-wrapper/issues/121
routerActions.replace({
...location,
query: {
...location.query,
redirect: location.query.redirect + (window.location.hash || ""),
},
}),
redirectAction: routerActions.replace,
});
const UserIsAdmin = UserAuthWrapper({
......
import { restore, signOut, USERS } from "__support__/cypress";
import { restore, signIn, signOut, USERS } from "__support__/cypress";
describe("scenarios > auth > signin", () => {
before(restore);
......@@ -32,4 +32,25 @@ describe("scenarios > auth > signin", () => {
cy.findByText("Sign in").click();
cy.contains(/[a-z ]+, Bob/i);
});
it("should redirect to a unsaved question after login", () => {
signIn();
cy.visit("/");
cy.contains("Browse Data").click();
cy.contains("Sample Dataset").click();
cy.contains("Orders").click();
cy.contains("37.65");
// signout and reload page with question hash in url
signOut();
cy.reload();
cy.contains("Sign in to Metabase");
cy.findByLabelText("Email address").type(USERS.admin.username);
cy.findByLabelText("Password").type(USERS.admin.password);
cy.findByText("Sign in").click();
// order table should load after login
cy.contains("37.65");
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment