diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Westminster.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Westminster.pm b/perllib/FixMyStreet/Cobrand/Westminster.pm index 9ae276f2b..ba65f75a6 100644 --- a/perllib/FixMyStreet/Cobrand/Westminster.pm +++ b/perllib/FixMyStreet/Cobrand/Westminster.pm @@ -44,4 +44,18 @@ sub anonymous_account { }; } +sub oidc_user_extra { + my ($self, $id_token) = @_; + + # Westminster want the CRM ID of the user to be passed in the + # account_id field of Open311 POST Service Requests, so + # extract it from the id token and store in user extra + # if it's available. + my $crm_id = $id_token->payload->{extension_CrmContactId}; + + return { + $crm_id ? (westminster_account_id => $crm_id) : (), + }; +} + 1; |