Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure, workspace setttings to ask for email for widget user. #70

Open
sanchitrk opened this issue Oct 4, 2024 · 1 comment
Open

Comments

@sanchitrk
Copy link
Contributor

// Check if the customer needs to provide additional identities.
// Ask for identities if the customer doesn't have a natural identity and isn't verified yet.
//
// Note: We can configure the workspace settings to have this enabled or disabled?
RequireIdentities := make([]string, 0, 3) // email, phone, externalId
if !customer.HasNaturalIdentity() && !customer.IsVerified && !skipIdentityCheck {
hasEmailIdentity, err := h.cs.HasProvidedEmailIdentity(ctx, customer.CustomerId)
if err != nil {
slog.Error("Failed to check customer email identity", slog.Any("err", err))
// If there's an error, we'll ask for email to be safe
RequireIdentities = append(RequireIdentities, "email")
} else if !hasEmailIdentity {
RequireIdentities = append(RequireIdentities, "email")
}
// Here you could add checks for other identity types if needed,
// For example, phone, external ID, etc.
}

@sanchitrk
Copy link
Contributor Author

It requires workspace settings changes, and you can add a workspace configuration model with defaults.
For now I can think of something like this:

workspace
- settings
   - widget
       - requireEmail: true

By default lets ask for email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant