Skip to content

Commit 7449fc9

Browse files
authored
Merge pull request #8 from humhub/fix/6-redirection-to-registration-fails
Fix #6: Redirection to registration form fails (e.g. when a profile f…
2 parents 02c8688 + 6ffa398 commit 7449fc9

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

authclient/LinkedinAuthV2.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace humhubContrib\auth\linkedin\authclient;
44

55
use yii\authclient\clients\LinkedIn;
6-
use humhub\helpers\ArrayHelper;
76

87
/**
98
* LinkedIn allows authentication via LinkedIn OAuth.
@@ -45,15 +44,9 @@ protected function defaultNormalizeUserAttributeMap()
4544
return [
4645
'id' => 'sub',
4746
'username' => 'displayName',
48-
'firstname' => function ($attributes) {
49-
return ArrayHelper::getValue($attributes, 'given_name', '');
50-
},
51-
'lastname' => function ($attributes) {
52-
return ArrayHelper::getValue($attributes, 'family_name', '');
53-
},
54-
'email' => function ($attributes) {
55-
return ArrayHelper::getValue($attributes, 'email', '');
56-
},
47+
'firstname' => 'given_name',
48+
'lastname' => 'family_name',
49+
'email' => 'email',
5750
];
5851
}
5952
}

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
1.1.1 (Unreleased)
55
--------------------
66
- Enh #7: Use PHP CS Fixer
7+
- Fix #6: Redirection to registration form fails (e.g. when a profile field is required) with version 2
78

89
1.1.0 (June 7, 2024)
910
--------------------

0 commit comments

Comments
 (0)