From fde2793659a41f4412e13d41ffa3d12c1953c1f5 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Tue, 18 Feb 2020 15:39:09 +0200 Subject: [PATCH 1/3] Add a null check for authScopes variable Check that the authScopes has a value in the LimitedAccessBanner component. --- src/components/LimitedAccessBanner/LimitedAccessBanner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/LimitedAccessBanner/LimitedAccessBanner.js b/src/components/LimitedAccessBanner/LimitedAccessBanner.js index 8057cf1b22..51c73ea193 100644 --- a/src/components/LimitedAccessBanner/LimitedAccessBanner.js +++ b/src/components/LimitedAccessBanner/LimitedAccessBanner.js @@ -27,6 +27,7 @@ const LimitedAccessBanner = props => { const showBanner = user.id && isAuthenticated && + authScopes && authScopes.length === 1 && authScopes[0] === 'user:limited' && !disabledPages.includes(currentPage); From f43c66d09dae43a9993fcdcd14b92f0111d14372 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Tue, 18 Feb 2020 16:01:25 +0200 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5053e9c571..0afa15ee1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ way to update this template, but currently, we follow a pattern: - [add] Show a banner when a user is logged in with limited access. [#1259](https://github.com/sharetribe/ftw-daily/pull/1259) + [#1261](https://github.com/sharetribe/ftw-daily/pull/1261) - [add] Support for logging in as a user from Console. [#1254](https://github.com/sharetribe/ftw-daily/pull/1254) - [change] Add `handlebars` 4.5.3 and `serialize-javascript` 2.1.1 to resolutions in `package.json`. From bc02fe031fab7de457af84b26e6dcaf9c768f418 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Tue, 18 Feb 2020 16:09:20 +0200 Subject: [PATCH 3/3] Fix typos --- server/apiRouter.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/apiRouter.js b/server/apiRouter.js index 9e668c6fb2..8e3c6d5711 100644 --- a/server/apiRouter.js +++ b/server/apiRouter.js @@ -3,7 +3,7 @@ * tasks that can not be handled in the browser. * * The endpoints should not clash with the application routes. Therefore, the - * enpoints are prefixed in the main server where this file is used. + * endpoints are prefixed in the main server where this file is used. */ const http = require('http'); @@ -23,8 +23,8 @@ const USING_SSL = process.env.REACT_APP_SHARETRIBE_USING_SSL === 'true'; const router = express.Router(); -// redirect_uri param used when initiating a login as authenitcation flow and -// when requesting a token useing an authorization code +// redirect_uri param used when initiating a login as authentication flow and +// when requesting a token using an authorization code const loginAsRedirectUri = `${ROOT_URL.replace(/\/$/, '')}/api/login-as`; // Instantiate HTTP(S) Agents with keepAlive set to true. @@ -50,14 +50,14 @@ const urlifyBase64 = base64Str => // Initiates an authorization code authentication flow. This authentication flow // enables marketplace operators that have an ongoing Console session to log -// into their marketplace as a user of the marketpalce. +// into their marketplace as a user of the marketplace. // -// The authroization code is requested from Console and it is used to request a +// The authorization code is requested from Console and it is used to request a // token from the Flex Auth API. // // This endpoint will return a 302 to Console which requests the authorization // code. Console returns a 302 with the code to the `redirect_uri` that is -// passed in this reponse. The request to the redirect URI is handled with the +// passed in this response. The request to the redirect URI is handled with the // `/login-as` endpoint. router.get('/initiate-login-as', (req, res) => { const userId = req.query.user_id;