Open
Conversation
Changes are based on https://wsvincent.com/django-allauth-tutorial/. The /example page loads with the correct CSS, but /accounts/logout and /accounts/login don't, which isn't surprising as they are using their default templates. Next tasks to do: * Plan what to do with django-invitations next. There's also some site design I want to do - what are the pages / views that we're serving? Can we at least have a decent index page after login for "here are things you might want to do, go and do them"? I'm going to take inspiration from Aquarion's design for https://dagon.church/ in that regard.
Navbar now includes username and logout link when a user is logged in. Index page now has a Github login link if the user is logged out, and only displays the links to visions if the user is logged in. example.html has been deleted because it was just used as part of the initial auth demo.
Login is only available via Github at the moment, so the template that needs copying is socialaccount/login.html. The logout template that needs copying is account/logout.html.
In order to make this work we also need to add a custom template for account/login.html. This is a good temporary fix, I think, but it would make more sense to default most of the website to requiring login and only make a few pages available if you're logged out.
This means that when we add more endpoints we won't accidentally forget to put them behind a login. LOGIN_REQUIRED_IGNORE_PATHS in settings.py needed some additions to make our login flow with Github OAuth work, but it seems to be okay now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in this PR:
The last one I'm very unsure of (as in, whether it does what I hope). This might be a good point to add some tests.