mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Merge pull request #1334 from rubenvereecken/name_check_fix
Worked in scott's comments and got tests working again
This commit is contained in:
commit
eb16c7985c
1 changed files with 3 additions and 5 deletions
|
@ -157,12 +157,10 @@ module.exports.setup = (app) ->
|
|||
res.send msg + '<p><a href="/account/settings">Account settings</a></p>'
|
||||
res.end()
|
||||
|
||||
app.get '/auth/name/?*', (req, res) ->
|
||||
app.get '/auth/name*', (req, res) ->
|
||||
parts = req.path.split '/'
|
||||
console.log parts
|
||||
originalName = parts[3]
|
||||
|
||||
return errors.badInput res, 'No name provided.' unless originalName and originalName isnt ''
|
||||
originalName = decodeURI parts[3]
|
||||
return errors.badInput res, 'No name provided.' unless parts.length > 3 and originalName? and originalName isnt ''
|
||||
return errors.notFound res if parts.length isnt 4
|
||||
|
||||
User.unconflictName originalName, (err, name) ->
|
||||
|
|
Loading…
Reference in a new issue