Feature/sso signup (#1555)
* updated saml-jackson * if logged in redirect to getting-started page with username in the query param * fixed issue with mixed up Google login, profile.id is undefined and this is causing the first record to be retrieved instead of the AND query failing * updated updated saml-jackson * document PGSSLMODE for Heroku * tweaks to PGSSLMODE doc * for self-hosted instance just allow user to signin with any identity (as long as email matches) * fixed submitting flag * added username to onboarding flow (if requested during signup) * added telemetry for google login, saml login, saml config * check if firstName and lastName are defined * convert mutation to an async op * added e2e test to ensure username query param gets picked up during onboarding * fixed minor typo and added note about configuring Google integration as an Internal app when self-hosting * cleaned up unnecessary ssr in sso signup routes * renamed function * Revert "cleaned up unnecessary ssr in sso signup routes" This reverts commit 3607ffef79542d8ca4277a64be38d35bd9457960. * moved client side code to useEffect hook * - format - fixed Save button in SAML config component Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
12 files changed
+1532
-1176
No files matched your search
@@ -2,6 +2,7 @@ import React, { useEffect, useState, useRef } from "react";
|
||||
|
||||
import { useLocale } from "@lib/hooks/useLocale";
|
||||
import showToast from "@lib/notification";
|
||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||
import { trpc } from "@lib/trpc";
|
||||
|
||||
import { Dialog, DialogTrigger } from "@components/Dialog";
|
||||
@@ -22,6 +23,8 @@ export default function SAMLConfiguration({
|
||||
|
||||
const query = trpc.useQuery(["viewer.showSAMLView", { teamsView, teamId }]);
|
||||
|
||||
const telemetry = useTelemetry();
|
||||
|
||||
useEffect(() => {
|
||||
const data = query.data;
|
||||
setIsSAMLLoginEnabled(data?.isSAMLLoginEnabled ?? false);
|
||||
@@ -66,8 +69,11 @@ export default function SAMLConfiguration({
|
||||
|
||||
const rawMetadata = samlConfigRef.current.value;
|
||||
|
||||
// track Google logins. Without personal data/payload
|
||||
telemetry.withJitsu((jitsu) => jitsu.track(telemetryEventTypes.samlConfig, collectPageParameters()));
|
||||
|
||||
mutation.mutate({
|
||||
rawMetadata: rawMetadata,
|
||||
encodedRawMetadata: Buffer.from(rawMetadata).toString("base64"),
|
||||
teamId,
|
||||
});
|
||||
}
|
||||
@@ -88,14 +94,14 @@ export default function SAMLConfiguration({
|
||||
{isSAMLLoginEnabled ? (
|
||||
<>
|
||||
<div className="mt-6">
|
||||
<h2 className="font-cal text-lg leading-6 font-medium text-gray-900">
|
||||
<h2 className="text-lg font-medium leading-6 text-gray-900 font-cal">
|
||||
{t("saml_configuration")}
|
||||
<Badge className="text-xs ml-2" variant={samlConfig ? "success" : "gray"}>
|
||||
<Badge className="ml-2 text-xs" variant={samlConfig ? "success" : "gray"}>
|
||||
{samlConfig ? t("enabled") : t("disabled")}
|
||||
</Badge>
|
||||
{samlConfig ? (
|
||||
<>
|
||||
<Badge className="text-xs ml-2" variant={"success"}>
|
||||
<Badge className="ml-2 text-xs" variant={"success"}>
|
||||
{samlConfig ? samlConfig : ""}
|
||||
</Badge>
|
||||
</>
|
||||
@@ -104,7 +110,7 @@ export default function SAMLConfiguration({
|
||||
</div>
|
||||
|
||||
{samlConfig ? (
|
||||
<div className="mt-2 flex">
|
||||
<div className="flex mt-2">
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button
|
||||
@@ -147,11 +153,7 @@ export default function SAMLConfiguration({
|
||||
/>
|
||||
|
||||
<div className="flex justify-end py-8">
|
||||
<button
|
||||
type="submit"
|
||||
className="ltr:ml-2 rtl:mr-2bg-neutral-900 border border-transparent rounded-sm shadow-sm py-2 px-4 inline-flex justify-center text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black">
|
||||
{t("save")}
|
||||
</button>
|
||||
<Button type="submit">{t("save")}</Button>
|
||||
</div>
|
||||
<hr className="mt-4" />
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user