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

perform login on request #103

Open
mdmoin7 opened this issue Feb 2, 2020 · 4 comments
Open

perform login on request #103

mdmoin7 opened this issue Feb 2, 2020 · 4 comments

Comments

@mdmoin7
Copy link

mdmoin7 commented Feb 2, 2020

how can i implement login at some specific point, the current implementation forces the user to login as soon as you launch the app or open the home page, what if the home page isn't protected page is login a mandate there. How to avoid this.

@juagarciaga
Copy link

If you are using react router, you can define which pages are public and which pages will be protected. Take a look https://reacttraining.com/react-router/web/example/auth-workflow

@mdmoin7
Copy link
Author

mdmoin7 commented Feb 3, 2020

I have already done that as per the readme you have provided an hoc for the same. But the problem is in index.ts we create the authentication context so as soon as app loads it redirects to the login page which I do not want, it should preferably redirect only on protected pages rather than just making the user login on first load.

@mdmoin7
Copy link
Author

mdmoin7 commented Feb 3, 2020

In the index.ts example you have a constant variable which is a Boolean if I try changing that value it never asks for login even protected pages are accessible without login than.

@Senelith
Copy link

Senelith commented Oct 26, 2020

@mdmoin7 were you able to make this work ? If so can you please share it. I'm facing the same problem.

cc: @salvoravida

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants