Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

5 changes: 2 additions & 3 deletions internal/cli/data/universal-login/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<link rel="icon" type="image/png" href="https://cdn.auth0.com/quantum-assets/dist/1.0.3/favicons/auth0-favicon-onlight.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Auth0 | Branding Customization</title>
<script type="module" crossorigin src="/assets/index-ec2d5a69.js"></script>
<link rel="stylesheet" href="/assets/index-ba9d88e4.css">
<script type="module" crossorigin src="/assets/index-BhFLcOJ_.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-LFqg0h6r.css">
</head>
<body>
<div id="root"></div>

</body>
</html>
8 changes: 8 additions & 0 deletions internal/cli/universal_login_customize.go
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,14 @@ func fetchBrandingThemeOrUseDefault(ctx context.Context, api *auth0.API) *manage
LogoURL: "",
SocialButtonsLayout: "bottom",
},
Identifiers: &management.BrandingThemeIdentifiers{
LoginDisplay: "unified",
OTPAutocomplete: true,
PhoneDisplay: management.BrandingThemePhoneDisplay{
Masking: "mask_digits",
Formatting: "international",
},
},
}
}

Expand Down
104 changes: 104 additions & 0 deletions internal/cli/universal_login_customize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,14 @@ func TestFetchUniversalLoginBrandingData(t *testing.T) {
LogoURL: "",
SocialButtonsLayout: "bottom",
},
Identifiers: &management.BrandingThemeIdentifiers{
LoginDisplay: "unified",
OTPAutocomplete: true,
PhoneDisplay: management.BrandingThemePhoneDisplay{
Formatting: "international",
Masking: "mask_digits",
},
},
},
Tenant: &tenantData{
FriendlyName: "My Test Tenant",
Expand Down Expand Up @@ -1795,6 +1803,102 @@ func TestSaveUniversalLoginBrandingData(t *testing.T) {
return mockAPI
},
},
{
name: "it submits theme identifiers to the theme endpoint",
input: &universalLoginBrandingData{
Settings: &management.Branding{
Colors: &management.BrandingColors{
Primary: auth0.String("#33ddff"),
PageBackground: auth0.String("#99aacc"),
},
},
Template: &management.BrandingUniversalLogin{
Body: auth0.String("<html></html>"),
},
Theme: &management.BrandingTheme{
Identifiers: &management.BrandingThemeIdentifiers{
LoginDisplay: "separate",
OTPAutocomplete: false,
PhoneDisplay: management.BrandingThemePhoneDisplay{
Masking: "show_all",
Formatting: "regional",
},
},
},
Partials: []partialsData{
{
"login": {
management.ScreenName("login"): {
management.InsertionPointFormContentStart: "<div>Updated Form Content Start</div>",
},
},
},
},
Prompts: []*promptData{
{
Language: "en",
Prompt: "login",
CustomText: map[string]interface{}{"key": "value"},
},
},
},
mockedAPI: func() *auth0.API {
mockBrandingAPI := mock.NewMockBrandingAPI(ctrl)
mockBrandingAPI.EXPECT().
Update(gomock.Any(), &management.Branding{
Colors: &management.BrandingColors{
Primary: auth0.String("#33ddff"),
PageBackground: auth0.String("#99aacc"),
},
}).
Return(nil)
mockBrandingAPI.EXPECT().
SetUniversalLogin(gomock.Any(), &management.BrandingUniversalLogin{
Body: auth0.String("<html></html>"),
}).
Return(nil)

mockBrandingThemeAPI := mock.NewMockBrandingThemeAPI(ctrl)
mockBrandingThemeAPI.EXPECT().
Default(gomock.Any()).
Return(&management.BrandingTheme{
ID: auth0.String("111"),
}, nil)
// The theme (including the identifiers block) is submitted
// verbatim to the theme endpoint.
mockBrandingThemeAPI.EXPECT().
Update(gomock.Any(), "111", &management.BrandingTheme{
Identifiers: &management.BrandingThemeIdentifiers{
LoginDisplay: "separate",
OTPAutocomplete: false,
PhoneDisplay: management.BrandingThemePhoneDisplay{
Masking: "show_all",
Formatting: "regional",
},
},
}).
Return(nil)

mockPromptAPI := mock.NewMockPromptAPI(ctrl)
mockPromptAPI.EXPECT().
SetCustomText(gomock.Any(), "login", "en", map[string]interface{}{"key": "value"}).
Return(nil)
mockPromptAPI.EXPECT().
SetPartials(gomock.Any(), management.PromptLogin, &management.PromptScreenPartials{
management.ScreenLogin: {
management.InsertionPointFormContentStart: "<div>Updated Form Content Start</div>",
},
}).
Return(nil)
mockAPI := &auth0.API{
Branding: mockBrandingAPI,
BrandingTheme: mockBrandingThemeAPI,
Prompt: mockPromptAPI,
}

return mockAPI
},
},
{
name: "it fails to save the universal login branding data if the branding api returns an error",
input: &universalLoginBrandingData{
Expand Down
20 changes: 0 additions & 20 deletions test/integration/quickstarts-test-cases.yaml

This file was deleted.

Loading