PerlDancer / PerlDancer/Dancer2-Plugin-Auth-Extensible

logged_in_user sub stores user_hash in the request object

Open
#89 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
10
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Because the user hash is stored in the request object, one doesn't benefit from storing the hash at all ie the sub never returns on L598.

We use the LDAP auth backend and I see an LDAP lookup for every page load irrespective of if the user has already authenticated.

Correct me if I'm wrong but wouldn't it be better to store the user hash in a session object?

https://github.com/PerlDancer/Dancer2-Plugin-Auth-Extensible/blob/master/lib/Dancer2/Plugin/Auth/Extensible.pm#L597

Contributor guide

No contributing guide indexed for this repository

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 lib/Dancer2/Plugin/Auth/Extensible.pm around logged_in_user at line 597, and trace how the user hash is stored in the request object. Reproduce the LDAP lookup across repeated page loads, then verify that the authentication state is retained in a session and avoids unnecessary lookups.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.