Skip to content

Commit

Permalink
Merge pull request #4189 from systeminit/simplified-signup-flow-feature
Browse files Browse the repository at this point in the history
fix(auth-portal): Enable a feature flag for the new simplified signup flow
  • Loading branch information
stack72 authored Jul 22, 2024
2 parents a911759 + 715dd16 commit 36535c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/auth-portal/src/pages/ProfilePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,17 @@ const saveHandler = async () => {

const completeProfileReq = await authStore.COMPLETE_PROFILE({});
if (completeProfileReq.result.success) {
if (authStore.user?.emailVerified) {
tracker.trackEvent("workspace_launcher_widget_click");
window.location.href = `${API_HTTP_URL}/workspaces/${workspacesStore.defaultWorkspace.id}/go`;
if (featureFlagsStore.SIMPLIFIED_SIGNUP) {
if (authStore.user?.emailVerified) {
tracker.trackEvent("workspace_launcher_widget_click");
window.location.href = `${API_HTTP_URL}/workspaces/${workspacesStore.defaultWorkspace.id}/go`;
} else {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
router.push({ name: "login-success" });
}
} else {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
router.push({ name: "login-success" });
router.push({ name: "workspaces" });
}
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions app/auth-portal/src/store/feature_flags.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ export const useFeatureFlagsStore = () => {
CREATE_WORKSPACES: false,
EDIT_WORKSPACES: false,
DELETE_WORKSPACE: false,
SIMPLIFIED_SIGNUP: false,
}),
onActivated() {
posthog.onFeatureFlags((flags) => {
this.OSS_RELEASE = flags.includes("featureOssRelease");
this.CREATE_WORKSPACES = flags.includes("create_workspaces");
// If you can create workspaces, editing workspaces will also be enabled.
this.DELETE_WORKSPACE = flags.includes("delete_workspace");
this.SIMPLIFIED_SIGNUP = flags.includes("simplified_signup_flow");
this.EDIT_WORKSPACES =
flags.includes("edit_workspaces") || this.CREATE_WORKSPACES;
});
Expand Down

0 comments on commit 36535c7

Please sign in to comment.