openlibhums / openlibhums/janeway
Inactive account holder cannot log in with ORCID
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 238
- Forks
- 97
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 8
Description
User story
Someone with Janeway user management privileges (an editor, press manager) has created an account for me in a Janeway installation. They've put in my ORCID, somehow (though we'd like to avoid manual ORCID entry #2610), maybe through the admin interface. Theoretically this should let me log in with that account via ORCID. If I try, Janeway runs this:
But if my account is inactive, I will not be logged in, I will be silently redirected to the site homepage, with no user-facing message. This is due to the check django.contrib.auth.backends.ModelBackend.user_can_authenticate being run when login is called.
Proposed solution
Check for account.is_active in the above Janeway view, and mark the account as active, and then run login. This is what we do for the registration flow, so why not here as well?
Alternatively (not ideal since the whole idea is to log in via ORCID, not email+password), add a helpful message via django messages, and redirect to the password reset step.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/core/views.py at lines 167-172 and compare the ORCID login flow with the registration flow's handling of inactive accounts. Confirm how Django authentication treats account.is_active, then verify that an inactive ORCID-linked account is activated and logged in without the silent homepage redirect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100