Skip to content

Commit

Permalink
Use logo param only
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondLuong3 committed Jan 9, 2025
1 parent f36f617 commit 9a9d98d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ describe('AuthService', () => {
}
}));

it('should login with branding', fakeAsync(() => {
it('should login with defined logo', fakeAsync(() => {
const env = new TestEnvironment();
when(mockedLocationService.origin).thenReturn('https://scriptureforge.org');

Expand All @@ -428,24 +428,6 @@ describe('AuthService', () => {
).last()[0];
expect(authOptions).toBeDefined();
if (authOptions != null) {
expect(authOptions.authorizationParams!.useBranding).toEqual(true);
expect(authOptions.authorizationParams!.logo).toBeDefined();
}
}));

it('should login without branding', fakeAsync(() => {
const env = new TestEnvironment();
when(mockedLocationService.origin).thenReturn('https://alternatename.org');

env.service.logIn({ returnUrl: 'test-returnUrl' });

verify(mockedWebAuth.loginWithRedirect(anything())).once();
const authOptions: RedirectLoginOptions | undefined = capture<RedirectLoginOptions | undefined>(
mockedWebAuth.loginWithRedirect
).last()[0];
expect(authOptions).toBeDefined();
if (authOptions != null) {
expect(authOptions.authorizationParams!.useBranding).toEqual(false);
expect(authOptions.authorizationParams!.logo).toBeDefined();
}
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,11 @@ export class AuthService {
const state: AuthState = { returnUrl };
const language: string = getAspCultureCookieLanguage(this.cookieService.get(ASP_CULTURE_COOKIE_NAME));
const ui_locales: string = language;
const allowedHosts = ['scriptureforge.org', 'qa.scriptureforge.org', 'localhost:5000'];
const url = new URL(this.locationService.origin);
const useBranding: boolean = allowedHosts.includes(url.host);
const auth0Parameters: xForgeAuth0Parameters = {
ui_locales: language,
enablePasswordless: true,
language,
login_hint: ui_locales,
useBranding,
logo: 'https://auth0.languagetechnology.org/assets/sf.svg'
};

Expand Down

0 comments on commit 9a9d98d

Please sign in to comment.