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

Fix: lowercase locales #551

Merged
merged 4 commits into from
May 28, 2020
Merged
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
5 changes: 3 additions & 2 deletions src/app/services/graph-client/msal-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export async function logIn(sessionId = ''): Promise<any> {
const loginRequest: AuthenticationParameters = {
scopes: defaultUserScopes,
prompt: 'select_account',
redirectUri: window.location.href.toLowerCase(),
extraQueryParameters: { mkt: geLocale }
};

Expand Down Expand Up @@ -82,8 +83,8 @@ export function logOutPopUp() {
// @ts-ignore
msalApplication.authorityInstance.resolveEndpointsAsync().then(authority => {
const urlNavigate = authority.EndSessionEndpoint
? authority.EndSessionEndpoint
: `${msalApplication.authority}oauth2/v2.0/logout`;
? authority.EndSessionEndpoint
: `${msalApplication.authority}oauth2/v2.0/logout`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean that every time the version changes, this part of the code will be changed?
I think you could have the version (URL with version) defined somewhere as a constant such that if the version is updated later, a search need not be done to make updates but just a change in some one line. What do you think?

(msalApplication as any).openPopup(urlNavigate, 'msal', 400, 600);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/common/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const createShareLink = (sampleQuery: IQuery, authenticated?: boolean): s

const url = new URL(sampleUrl);
const graphUrl = url.origin;
const appUrl = 'https://developer.microsoft.com/' + geLocale + '/graph/graph-explorer/preview';
const appUrl = 'https://developer.microsoft.com/' + geLocale.toLowerCase() + '/graph/graph-explorer';
/**
* To ensure backward compatibility the version is removed from the pathname.
* V3 expects the request query param to not have the version number.
Expand Down