Last active
January 1, 2020 23:02
-
-
Save hiranya911/2d5eb200b4d6aa4f13aac550f93e1548 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create a new auth.TenantClient instance. | |
| tenantClient, err := client.TenantManager.AuthForTenant(tenantID) | |
| if err != nil { | |
| log.Fatalf("error initializing tenant client: %v\n", err) | |
| } | |
| params := (&auth.UserToCreate{}). | |
| Email("[email protected]"). | |
| EmailVerified(true). | |
| PhoneNumber("+15555550100"). | |
| Password("secret"). | |
| DisplayName("Alice Redfield"). | |
| Disabled(false) | |
| // All tenant-specific operations are exposed via auth.TenantClient | |
| u, err := tenantClient.CreateUser(ctx, params) | |
| if err != nil { | |
| log.Fatalf("error creating user: %v\n", err) | |
| } | |
| u, err = tenantClient.GetUserByEmail(ctx, "[email protected]") | |
| if err != nil { | |
| log.Fatalf("error retrieving user: %v\n", err) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment