Skip to content
Snippets Groups Projects
Unverified Commit 38fca643 authored by Nick Fitzpatrick's avatar Nick Fitzpatrick Committed by GitHub
Browse files

check for enable-password-login (#32655)

parent 683e30ef
No related branches found
No related tags found
No related merge requests found
......@@ -247,6 +247,21 @@ describe("scenarios > admin > people", () => {
cy.location().should(loc => expect(loc.pathname).to.eq("/admin/people"));
});
it("should not offer to reset passwords when password login is disabled", () => {
cy.request("PUT", "/api/google/settings", {
"google-auth-auto-create-accounts-domain": null,
"google-auth-client-id": "example1.apps.googleusercontent.com",
"google-auth-enabled": true,
});
cy.request("PUT", "/api/setting", {
"enable-password-login": false,
});
cy.visit("/admin/people");
showUserOptions(normalUserName);
popover().findByText("Reset password").should("not.exist");
});
it(
"should reset user password with SMTP set up",
{ tags: "@external" },
......
/* eslint-disable react/prop-types */
import { Fragment, useMemo } from "react";
import { t } from "ttag";
import moment from "moment-timezone";
import { color } from "metabase/lib/colors";
import { getFullName } from "metabase/lib/user";
import * as Urls from "metabase/lib/urls";
import { useSelector } from "metabase/lib/redux";
import EntityMenu from "metabase/components/EntityMenu";
import { Icon } from "metabase/core/components/Icon";
import Link from "metabase/core/components/Link";
......@@ -14,8 +15,11 @@ import Tooltip from "metabase/core/components/Tooltip";
import UserAvatar from "metabase/components/UserAvatar";
import LoadingSpinner from "metabase/components/LoadingSpinner";
import { PLUGIN_ADMIN_USER_MENU_ITEMS } from "metabase/plugins";
import { getSetting } from "metabase/selectors/settings";
import MembershipSelect from "./MembershipSelect";
const enablePasswordLoginKey = "enable-password-login";
const PeopleListRow = ({
user,
showDeactivated,
......@@ -38,6 +42,10 @@ const PeopleListRow = ({
const isLoadingGroups = !groups;
const isPasswordLoginEnabled = useSelector(state =>
getSetting(state, enablePasswordLoginKey),
);
return (
<tr key={user.id}>
<td className="flex align-center">
......@@ -106,7 +114,7 @@ const PeopleListRow = ({
title: t`Edit user`,
link: Urls.editUser(user.id),
},
{
isPasswordLoginEnabled && {
title: t`Reset password`,
link: Urls.resetPassword(user.id),
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment