$req->user not available in plugins authenticated routes
When creating a plugin that add an authroute:
sub init {
my ($self) = @_;
$self->addAuthRoute( addLinkedIn => 'linkedin', [ 'GET' ] );
return 1;
}
We can't find user main identifier in $req->user:
sub linkedin {
my ($self, $req) = @_;
my $userid = $req->user;
$self->p->logger->debug("Associate LinkedIn account for $userid");
return PE_OK;
}
But we have $req->userData. We should maybe always provide $req->user to have consistent code in plugins.