Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

onprem: redirect to login page if in private mode #505

Merged
merged 2 commits into from
Aug 3, 2018

Conversation

n-riesco
Copy link
Contributor

@n-riesco n-riesco commented Aug 2, 2018

@n-riesco n-riesco requested a review from tarzzz August 2, 2018 16:15
// If not logged in and on-promise private-mode, redirect to login page
const plotlyAuthToken = req.cookies['plotly-auth-token'];
const onprem = getSetting('IS_RUNNING_INSIDE_ON_PREM');
if (path === '/' && !plotlyAuthToken && onprem) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This will also redirect to login when "private mode" is not enabled which we do not want.

We should be checking for "AUTH_ENABLED" setting for the redirects..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Github doesn't show it in the diff, but see that we have checked AUTH_ENABLED in the lines above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, thanks for the info.

We should still redirect to /external-data-connector/# instead of just /# ..

Copy link
Contributor

@tarzzz tarzzz left a comment

Choose a reason for hiding this comment

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

We should be checking for "AUTH_ENABLED" setting for the redirect to "/#"..

@n-riesco
Copy link
Contributor Author

n-riesco commented Aug 2, 2018

@tarzzz I've updated the redirection as advised on Slack. Thanks!

@tarzzz
Copy link
Contributor

tarzzz commented Aug 3, 2018

  • Tested in onprem (both private and non-private mode).

💃 ..

@n-riesco n-riesco merged commit 0a1d8c4 into master Aug 3, 2018
@n-riesco n-riesco deleted the onprem/fix-private-mode branch August 29, 2018 15:02
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants