Skip to content

Commit

Permalink
Add user's UUID to the response of relevant login API handlers
Browse files Browse the repository at this point in the history
remp/dn-mofa#538
  • Loading branch information
rootpd committed May 23, 2024
1 parent bd84afb commit 2ed79c9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ Response:
"status": "ok",
"user": {
"id": 1,
"uuid": "35e6b53c-340c-4dc3-ad36-f81b2b1f00a8",
"email": "[email protected]",
"confirmed_at": "2021-01-01T10:00:00+01:00", // RFC3339 date or NULL; user confirmation date
"first_name": "Test",
Expand Down Expand Up @@ -359,6 +360,7 @@ Success response:
"status": "ok",
"user": {
"id": 9,
"uuid": "35e6b53c-340c-4dc3-ad36-f81b2b1f00a8",
"email": "[email protected]",
"confirmed_at": "2021-01-01T10:00:00+01:00", // RFC3339 date or NULL; user confirmation date
"first_name": "Test",
Expand Down Expand Up @@ -605,6 +607,7 @@ Success response:
"status": "ok",
"user": {
"id": 101,
"uuid": "35e6b53c-340c-4dc3-ad36-f81b2b1f00a8",
"email": "[email protected]",
"confirmed_at": "2021-01-01T10:00:00+01:00", // RFC3339 date or NULL; user confirmation date
"first_name": null,
Expand Down Expand Up @@ -1300,6 +1303,7 @@ Success response:
"status": "ok",
"user": {
"id": 9,
"uuid": "35e6b53c-340c-4dc3-ad36-f81b2b1f00a8",
"email": "[email protected]",
"confirmed_at": "2021-01-01T10:00:00+01:00", // RFC3339 date or NULL; user confirmation date
"public_name": "[email protected]",
Expand Down Expand Up @@ -1541,6 +1545,7 @@ Success response:
"status": "ok",
"user": {
"id": 101,
"uuid": "35e6b53c-340c-4dc3-ad36-f81b2b1f00a8",
"email": "[email protected]",
"created_at": "2021-01-01T10:00:00+01:00", // RFC3339 date; user creation date
"confirmed_at": "2021-01-01T10:00:00+01:00", // RFC3339 date or NULL; user confirmation date
Expand Down Expand Up @@ -1584,6 +1589,7 @@ Success response:
"status": "ok",
"user": {
"id": 101,
"uuid": "35e6b53c-340c-4dc3-ad36-f81b2b1f00a8",
"email": "[email protected]",
"created_at": "2021-01-01T10:00:00+01:00", // RFC3339 date; user creation date
"confirmed_at": "2021-01-01T10:00:00+01:00", // RFC3339 date or NULL; user confirmation date
Expand Down
1 change: 1 addition & 0 deletions src/Api/AppleTokenSignInHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private function formatResponse(ActiveRow $user, ?ActiveRow $accessToken): array
'status' => 'ok',
'user' => [
'id' => $user->id,
'uuid' => $user->uuid,
'email' => $user->email,
'created_at' => $user->created_at->format(\DateTimeInterface::RFC3339),
'confirmed_at' => $user->confirmed_at?->format(\DateTimeInterface::RFC3339),
Expand Down
1 change: 1 addition & 0 deletions src/Api/AutoLoginTokenLoginApiHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function handle(array $params): ResponseInterface
'status' => 'ok',
'user' => [
'id' => $identity->id,
'uuid' => $identity->uuid,
'email' => $identity->data['email'],
'confirmed_at' => $identity->data['confirmed_at'] ? $identity->data['confirmed_at']->format(DATE_RFC3339) : null,
'public_name' => $identity->data['public_name'],
Expand Down
1 change: 1 addition & 0 deletions src/Api/GoogleTokenSignInHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ private function formatResponse(ActiveRow $user, ?ActiveRow $accessToken): array
'status' => 'ok',
'user' => [
'id' => $user->id,
'uuid' => $user->uuid,
'email' => $user->email,
'created_at' => $user->created_at->format(\DateTimeInterface::RFC3339),
'confirmed_at' => $user->confirmed_at?->format(\DateTimeInterface::RFC3339),
Expand Down
1 change: 1 addition & 0 deletions src/Api/UserInfoHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function handle(array $params): ResponseInterface
'status' => 'ok',
'user' => [
'id' => $user->id,
'uuid' => $user->uuid,
'email' => $user->email,
'first_name' => $user->first_name,
'last_name' => $user->last_name,
Expand Down
1 change: 1 addition & 0 deletions src/Api/UsersCreateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ private function formatResponse(ActiveRow $user, ?ActiveRow $lastToken): array
'status' => 'ok',
'user' => [
'id' => $user->id,
'uuid' => $user->uuid,
'email' => $user->email,
'first_name' => $user->first_name,
'last_name' => $user->last_name,
Expand Down
1 change: 1 addition & 0 deletions src/Api/UsersLoginHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function handle(array $params): ResponseInterface
'status' => 'ok',
'user' => [
'id' => $user->id,
'uuid' => $user->uuid,
'email' => $user->email,
'first_name' => $user->first_name,
'last_name' => $user->last_name,
Expand Down

0 comments on commit 2ed79c9

Please sign in to comment.