mirror of
https://github.com/1f349/dendrite.git
synced 2024-12-26 10:06:31 +00:00
Don't validate username when fetching registration flows (#259)
This commit is contained in:
parent
6bec139544
commit
bdfade26ed
@ -135,6 +135,20 @@ func Register(
|
||||
if resErr != nil {
|
||||
return *resErr
|
||||
}
|
||||
|
||||
// All registration requests must specify what auth they are using to perform this request
|
||||
if r.Auth.Type == "" {
|
||||
return util.JSONResponse{
|
||||
Code: 401,
|
||||
// TODO: Hard-coded 'dummy' auth for now with a bogus session ID.
|
||||
// Server admins should be able to change things around (eg enable captcha)
|
||||
JSON: newUserInteractiveResponse(time.Now().String(), []authFlow{
|
||||
{[]authtypes.LoginType{authtypes.LoginTypeDummy}},
|
||||
{[]authtypes.LoginType{authtypes.LoginTypeSharedSecret}},
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
if resErr = validate(r.Username, r.Password); resErr != nil {
|
||||
return *resErr
|
||||
}
|
||||
@ -151,19 +165,6 @@ func Register(
|
||||
// TODO: Enable registration config flag
|
||||
// TODO: Guest account upgrading
|
||||
|
||||
// All registration requests must specify what auth they are using to perform this request
|
||||
if r.Auth.Type == "" {
|
||||
return util.JSONResponse{
|
||||
Code: 401,
|
||||
// TODO: Hard-coded 'dummy' auth for now with a bogus session ID.
|
||||
// Server admins should be able to change things around (eg enable captcha)
|
||||
JSON: newUserInteractiveResponse(time.Now().String(), []authFlow{
|
||||
{[]authtypes.LoginType{authtypes.LoginTypeDummy}},
|
||||
{[]authtypes.LoginType{authtypes.LoginTypeSharedSecret}},
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Handle loading of previous session parameters from database.
|
||||
// TODO: Handle mapping registrationRequest parameters into session parameters
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user