Auth::Custom calls module init twice
Concerned version
Version: 2.0.13
Summary
- Set authentication to Custom
- Set customAuth to "::Auth::OpenIDConnect"
Logs
[info] Loading configuration 29 for process 91818
[warn] Route "flogout" redefined
[warn] Route "flogout" redefined
[warn] Route "blogout" redefined
[warn] Route "blogout" redefined
[warn] Route "flogout" redefined
[warn] Route "flogout" redefined
[warn] Route "blogout" redefined
[warn] Route "blogout" redefined
[info] No cookie found
Reason is:
- loadModule(Auth::Custom) calls Auth::Custom->new during portal init
- Auth::Custom->new calls loadModule(Auth::OpenIDConnect)
- loadModule(Auth::OpenIDConnect) calls Auth::OpenIDConnect->new
- Auth::OpenIDConnect->new returns Auth::OpenIDConnect instance
- loadModule(Auth::OpenIDConnect) calls init on Auth::OpenIDConnect instance
- loadModule(Auth::OpenIDConnect) calls Auth::OpenIDConnect->new
- Auth::Custom->new returns a new Auth::OpenIDConnect instance
- Auth::Custom->new calls loadModule(Auth::OpenIDConnect)
- loadModule(Auth::Custom) calls init on the received Auth::OpenIDConnect instance
- At this step, Auth::OpenIDConnect->init is called for the second time.
Possible fixes
Perhaps Auth::Custom should not call loadModule? but manually load the perl module and instanciate it?
I'm not sure what are the implications, any ideas @guimard ?