Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
9e09a180
Unverified
Commit
9e09a180
authored
7 years ago
by
David Baker
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2629 from matrix-org/rav/register_inhibit_login
support inhibit_login in /register
parents
4a6754ba
6c3a0207
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/rest/client/v2_alpha/register.py
+16
-12
16 additions, 12 deletions
synapse/rest/client/v2_alpha/register.py
with
16 additions
and
12 deletions
synapse/rest/client/v2_alpha/register.py
+
16
−
12
View file @
9e09a180
...
...
@@ -557,24 +557,28 @@ class RegisterRestServlet(RestServlet):
Args:
(str) user_id: full canonical @user:id
(object) params: registration parameters, from which we pull
device_id
and
initial_device_name
device_id
,
initial_device_name
and inhibit_login
Returns:
defer.Deferred: (object) dictionary for response from /register
"""
device_id
=
yield
self
.
_register_device
(
user_id
,
params
)
result
=
{
"
user_id
"
:
user_id
,
"
home_server
"
:
self
.
hs
.
hostname
,
}
if
not
params
.
get
(
"
inhibit_login
"
,
False
):
device_id
=
yield
self
.
_register_device
(
user_id
,
params
)
access_token
=
(
yield
self
.
auth_handler
.
get_access_token_for_user_id
(
user_id
,
device_id
=
device_id
,
access_token
=
(
yield
self
.
auth_handler
.
get_access_token_for_user_id
(
user_id
,
device_id
=
device_id
,
)
)
)
defer
.
returnValue
({
"
user_id
"
:
user_id
,
"
access_token
"
:
access_token
,
"
home_server
"
:
self
.
hs
.
hostname
,
"
device_id
"
:
device_id
,
})
result
.
update
({
"
access_token
"
:
access_token
,
"
device_id
"
:
device_id
,
})
defer
.
returnValue
(
result
)
def
_register_device
(
self
,
user_id
,
params
):
"""
Register a device for a user.
...
...
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