From 445eed99be4a526b831ca1ba7ac7332f5aede4e4 Mon Sep 17 00:00:00 2001 From: vladimiratanasov <67702437+vladimiratanasov@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:05:06 +0000 Subject: [PATCH 1/4] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index fa6986b..c1f1960 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ ## Table of Contents * [Summary](#summary) * [Requirements](#requirements) +* [Migrating from v6 to v7](#migrating-from-v6-to-v7) * [Installation](#installation) * [Example Usage](#example-usage) * [License](#license) @@ -33,6 +34,15 @@ Read the [official documentation](https://console.ng.bluemix.net/docs/services/a ## Requirements * npm 6.+ * node 12.+ +* passport.js 0.6.0+ + +## Migrating from v6 to v7 +Breaking changes in passport.js require users to pass the `{ keepSessionInfo: true }` object to the middleware when protecting endpoints. +``` +app.use(passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); + +app.get(CALLBACK_URL, passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); +``` ## Installation ``` From 6d29a4b1b0e1bcc7e0bccb09b112de50dd512958 Mon Sep 17 00:00:00 2001 From: vladimiratanasov <67702437+vladimiratanasov@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:11:38 +0000 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c1f1960..a4c51f5 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Read the [official documentation](https://console.ng.bluemix.net/docs/services/a * passport.js 0.6.0+ ## Migrating from v6 to v7 -Breaking changes in passport.js require users to pass the `{ keepSessionInfo: true }` object to the middleware when protecting endpoints. +Breaking changes in passport.js require users to pass the `{ keepSessionInfo: true }` object to the middleware when protecting endpoints when using WebAppStrategy. ``` app.use(passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); From 101910f1c2a132548e1a6fadcf1430cb1c7d4201 Mon Sep 17 00:00:00 2001 From: vladimiratanasov <67702437+vladimiratanasov@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:15:05 +0000 Subject: [PATCH 3/4] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4c51f5..039e8dc 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,19 @@ Read the [official documentation](https://console.ng.bluemix.net/docs/services/a ## Migrating from v6 to v7 Breaking changes in passport.js require users to pass the `{ keepSessionInfo: true }` object to the middleware when protecting endpoints when using WebAppStrategy. + +Old Usage (SDK v6): ``` -app.use(passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); +javascript +app.use(passport.authenticate(WebAppStrategy.STRATEGY_NAME)); +app.get(CALLBACK_URL, passport.authenticate(WebAppStrategy.STRATEGY_NAME)); +``` +New Usage (SDK v7): +In SDK version 7, when using webappStrategy, you need to pass { keepSessionInfo: true } to the passport.authenticate method. Update your code as follows: +``` +javascript +app.use(passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); app.get(CALLBACK_URL, passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); ``` From fc41a53d0c5c61c9cb73e665f97840fe3a6d0805 Mon Sep 17 00:00:00 2001 From: vladimiratanasov <67702437+vladimiratanasov@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:15:25 +0000 Subject: [PATCH 4/4] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 039e8dc..1e7bb1a 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,6 @@ Breaking changes in passport.js require users to pass the `{ keepSessionInfo: tr Old Usage (SDK v6): ``` -javascript app.use(passport.authenticate(WebAppStrategy.STRATEGY_NAME)); app.get(CALLBACK_URL, passport.authenticate(WebAppStrategy.STRATEGY_NAME)); ``` @@ -49,7 +48,6 @@ New Usage (SDK v7): In SDK version 7, when using webappStrategy, you need to pass { keepSessionInfo: true } to the passport.authenticate method. Update your code as follows: ``` -javascript app.use(passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); app.get(CALLBACK_URL, passport.authenticate(WebAppStrategy.STRATEGY_NAME, { keepSessionInfo: true })); ```