impossible to use getModule in the Password modules
Concerned version
Version: %2.0.13
Platform: any
Summary
As suggested by examples in Password/Base.pm
, the function:
$self->p->getModule( $req, 'auth' )
could be used to get the current authentication module.
For example, this is working in a userDB module, but not in a PasswordDB module, because $req is not populated.
The use case is the following:
- authentication: Choice
- userDB: Same
- password: Choice
choices are:
- Auth1;User1;Password1
- Auth2;User2;Password1
The goal is to be able, in Password1 module, to know if user has authenticated with Auth1 or Auth2.
Useful pointers:
- Portal/Main/Run.pm: function getModule
- Portal/Lib/Choice.pm: function name (selecting the correct module)
Possible fixes
Maybe can we check the current session instead of $req when the session in available?