Fix crash on null idp for SSO buttons (#8650)
* Add test case for null identity_providers for SSO * Fix typing for identity_providers * Make null idp explicit and handle in analytics * chore: whitespace fix Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -29,7 +29,7 @@ import { mediaFromMxc } from "../../../customisations/Media";
|
||||
import { PosthogAnalytics } from "../../../PosthogAnalytics";
|
||||
|
||||
interface ISSOButtonProps extends Omit<IProps, "flow"> {
|
||||
idp: IIdentityProvider;
|
||||
idp?: IIdentityProvider;
|
||||
mini?: boolean;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ const SSOButton: React.FC<ISSOButtonProps> = ({
|
||||
const label = idp ? _t("Continue with %(provider)s", { provider: idp.name }) : _t("Sign in with single sign-on");
|
||||
|
||||
const onClick = () => {
|
||||
const authenticationType = getAuthenticationType(idp.brand);
|
||||
const authenticationType = getAuthenticationType(idp?.brand ?? "");
|
||||
PosthogAnalytics.instance.setAuthenticationType(authenticationType);
|
||||
PlatformPeg.get().startSingleSignOn(matrixClient, loginType, fragmentAfterLogin, idp?.id);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user