openlibhums / openlibhums/janeway

Inactive account holder cannot log in with ORCID

Open
#4,751 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug dev-ready
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:

https://github.com/openlibhums/janeway/blob/836a651b281714d40f20f99a94e466a4c0050ef6/src/core/views.py#L167-L172

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.