mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 07:23:10 -06:00
Self-review
This commit is contained in:
parent
a0bcffa68e
commit
a647d633dd
|
|
@ -5,7 +5,5 @@ type LoginType string
|
||||||
|
|
||||||
// The relevant login types implemented in Dendrite
|
// The relevant login types implemented in Dendrite
|
||||||
const (
|
const (
|
||||||
LoginTypeDummy = "m.login.dummy"
|
LoginTypeDummy = "m.login.dummy"
|
||||||
LoginTypeRecaptcha = "m.login.recaptcha"
|
|
||||||
LoginTypePassword = "m.login.password"
|
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ type registerRequest struct {
|
||||||
type authDict struct {
|
type authDict struct {
|
||||||
Type types.LoginType `json:"type"`
|
Type types.LoginType `json:"type"`
|
||||||
Session string `json:"session"`
|
Session string `json:"session"`
|
||||||
|
// TODO: Lots of custom keys depending on the type
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://matrix.org/speculator/spec/HEAD/client_server/unstable.html#user-interactive-authentication-api
|
// http://matrix.org/speculator/spec/HEAD/client_server/unstable.html#user-interactive-authentication-api
|
||||||
|
|
@ -106,7 +107,8 @@ func Register(req *http.Request, accountDB *storage.AccountDatabase) util.JSONRe
|
||||||
if r.Auth.Type == "" {
|
if r.Auth.Type == "" {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 401,
|
Code: 401,
|
||||||
// Hard-coded 'dummy' auth for now with a bogus session ID.
|
// 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("totallyuniquesessionid", []flow{
|
JSON: newUserInteractiveResponse("totallyuniquesessionid", []flow{
|
||||||
flow{[]types.LoginType{types.LoginTypeDummy}},
|
flow{[]types.LoginType{types.LoginTypeDummy}},
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue