Skip to content

Conversation

longmach
Copy link

Add log in and log out buttons using Auth0 for authorization and authentication

Add log in and log out buttons using Auth0 for authorization and authentication
Copy link
Member

@martukas martukas left a comment

Choose a reason for hiding this comment

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

In addition to the code comments:

  • you should install pre-commit hooks to help with code style & autoformatting, then the CI test will pass. I think the article in the ventilator wiki will apply to this repo just the same: https://github.com/RespiraWorks/Ventilator/wiki/git-precommit-hooks
  • it would help if you would provide a link to an instance of this that you have deployed somewhere for testing? In the future we should maybe have some semi-automatic way to do thsi for PRs. I added some comments to #14 , which may actually be a good next task to tackle.

<App />
</React.StrictMode>
<Auth0Provider
domain="dev-gi520dy8.us.auth0.com"
Copy link
Member

Choose a reason for hiding this comment

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

are these ok to go into public repository, or should they be part of the .env file? If the latter, please update documentation to explain that additional fields are needed and where to get the values for them.

<Route path="/dataset" element={<DataSet />} />
<Route path="*" element={<NotFound />} />
</Routes>
<LoginButton/>
Copy link
Member

@martukas martukas Jul 15, 2022

Choose a reason for hiding this comment

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

So, the way most websites are, I think, is what users will expect:

  • login page (rather than just button) only visible when you are not logged in, and it redirects to this page whenever you try to access something that requires authorization
  • user profile info probably visible on the navbar on the right (and only when logged in), and logout is an option with a dropdown from that

I guess let's think of Google itself as the template for how people expect these to work?

I think most of this can be done pretty easily within the bootstrap framework. The auto-redirect thing is also abstracted by something like this:
https://github.com/jaredhanson/connect-ensure-login

and I had a few more links to useful things on the ticket #3

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

Successfully merging this pull request may close these issues.

2 participants