Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IA2
RAP
Commits
60c453ef
Commit
60c453ef
authored
4 years ago
by
Sonia Zorba
Browse files
Options
Downloads
Patches
Plain Diff
Parsed GMS join response
parent
5dab97dd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
classes/login/GmsClient.php
+6
-3
6 additions, 3 deletions
classes/login/GmsClient.php
with
6 additions
and
3 deletions
classes/login/GmsClient.php
+
6
−
3
View file @
60c453ef
...
@@ -36,7 +36,13 @@ class GmsClient {
...
@@ -36,7 +36,13 @@ class GmsClient {
$info
=
curl_getinfo
(
$conn
);
$info
=
curl_getinfo
(
$conn
);
if
(
$info
[
'http_code'
]
===
200
)
{
if
(
$info
[
'http_code'
]
===
200
)
{
error_log
(
$response
);
$joinResult
=
json_decode
(
$response
);
curl_close
(
$conn
);
curl_close
(
$conn
);
if
(
!
array_key_exists
(
'mergedId'
,
$joinResult
))
{
throw
new
ServerErrorException
(
'GMS join response has an invalid payload'
);
}
return
$joinResult
->
mergedId
;
}
else
{
}
else
{
//show information regarding the error
//show information regarding the error
curl_close
(
$conn
);
curl_close
(
$conn
);
...
@@ -47,9 +53,6 @@ class GmsClient {
...
@@ -47,9 +53,6 @@ class GmsClient {
}
}
throw
new
ServerErrorException
(
'Error: GMS response code: '
.
$httpCode
);
throw
new
ServerErrorException
(
'Error: GMS response code: '
.
$httpCode
);
}
}
// TODO: return id extracted from GMS response
return
$userId1
;
}
}
private
function
getJoinAccessToken
(
int
$userId1
,
int
$userId2
):
string
{
private
function
getJoinAccessToken
(
int
$userId1
,
int
$userId2
):
string
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment