@@ -15,7 +15,7 @@ const UserAccount = require('../models/user-account')
1515class LoginByPasswordRequest {
1616 /**
1717 * @constructor
18- * @param [ options={ }] {Object}
18+ * @param options {Object}
1919 *
2020 * @param [options.username] {string} Unique identifier submitted by user
2121 * from the Login form. Can be one of:
@@ -31,7 +31,7 @@ class LoginByPasswordRequest {
3131 * @param [options.authQueryParams] {Object} Key/value hashmap of parsed query
3232 * parameters that will be passed through to the /authorize endpoint.
3333 */
34- constructor ( options = { } ) {
34+ constructor ( options ) {
3535 this . username = options . username
3636 this . password = options . password
3737 this . response = options . response
@@ -82,12 +82,12 @@ class LoginByPasswordRequest {
8282 * Factory method, returns an initialized instance of LoginByPasswordRequest
8383 * from an incoming http request.
8484 *
85- * @param [ req={ }] {IncomingRequest}
86- * @param [ res={ }] {ServerResponse}
85+ * @param req {IncomingRequest}
86+ * @param res {ServerResponse}
8787 *
8888 * @return {LoginByPasswordRequest }
8989 */
90- static fromParams ( req = { } , res = { } ) {
90+ static fromParams ( req , res ) {
9191 let body = req . body || { }
9292
9393 let userStore , accountManager
@@ -299,9 +299,6 @@ class LoginByPasswordRequest {
299299 } else if ( validUser ) {
300300 // Login request is a user going to /login in browser
301301 uri = this . accountManager . accountUriFor ( validUser . username )
302- } else {
303- let host = this . accountManager . host
304- uri = host . serverUri
305302 }
306303
307304 return uri
@@ -314,6 +311,7 @@ class LoginByPasswordRequest {
314311 // Login/register request is part of an app's auth flow
315312 uri = this . authorizeUrl ( )
316313 } else {
314+ // User went to /register directly, not part of an auth flow
317315 let host = this . accountManager . host
318316 uri = host . serverUri
319317 }
0 commit comments