Skip to content
This repository was archived by the owner on Jun 25, 2023. It is now read-only.

Commit 63c359a

Browse files
authored
Merge pull request #19 from Azure-Samples/dev
Merge dev to main
2 parents 39f572b + 36e6ecf commit 63c359a

10 files changed

Lines changed: 47 additions & 9 deletions

demo/App/routes/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ module.exports = (authProvider) => {
4545
mainController.getTenantPage
4646
); // get token for this route to call web API
4747

48-
// unauthorized
48+
// error
4949
router.get('/error', (req, res) => res.redirect('/401.html'));
5050

51-
// error
51+
// unauthorized
5252
router.get('/unauthorized', (req, res) => res.redirect('/500.html'));
5353

5454
// 404

dist/UrlUtils.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ export declare class UrlUtils {
77
* @returns {string}
88
*/
99
static ensureAbsoluteUrl: (req: Request, url: string) => string;
10+
/**
11+
* Gets the path segment from a given URL
12+
* @param {string} url: a given URL
13+
* @returns {string}
14+
*/
15+
static getPathFromUrl: (url: string) => string;
1016
}

dist/msal-express-wrapper.cjs.development.js

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/msal-express-wrapper.cjs.development.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/msal-express-wrapper.cjs.production.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/msal-express-wrapper.cjs.production.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/msal-express-wrapper.esm.js

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/msal-express-wrapper.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AuthProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class AuthProvider {
116116
const appRouter = express.Router();
117117

118118
// handle redirect
119-
appRouter.get(this.appSettings.authRoutes.redirect, this.handleRedirect());
119+
appRouter.get(UrlUtils.getPathFromUrl(this.appSettings.authRoutes.redirect), this.handleRedirect());
120120

121121
if (this.appSettings.authRoutes.frontChannelLogout) {
122122
/**

src/UrlUtils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,14 @@ export class UrlUtils {
2525
return url;
2626
}
2727
};
28+
29+
/**
30+
* Gets the path segment from a given URL
31+
* @param {string} url: a given URL
32+
* @returns {string}
33+
*/
34+
static getPathFromUrl = (url: string): string => {
35+
const urlComponents: IUri = new UrlString(url).getUrlComponents();
36+
return `/${urlComponents.PathSegments.join("/")}`;
37+
};
2838
}

0 commit comments

Comments
 (0)