mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-30 14:51:13 -04:00
Trying to handle a case where a user did not have their user account created.
This commit is contained in:
parent
3680d628e7
commit
9726840d8a
2 changed files with 6 additions and 1 deletions
|
@ -43,7 +43,12 @@ init = ->
|
|||
module.exports.me = window.me = new User(storedUser)
|
||||
me.url = -> '/auth/whoami'
|
||||
me.fetch()
|
||||
|
||||
retry = -> me.fetch() # blindly try again
|
||||
error = -> setTimeout(retry, 1000) # blindly try again
|
||||
me.on 'error', error, @
|
||||
me.on 'sync', ->
|
||||
me.off 'error', error, @ if firstTime
|
||||
me.url = -> "/db/user/#{me.id}"
|
||||
trackFirstArrival() if firstTime
|
||||
if me and not me.get('testGroupNumber')?
|
||||
|
|
|
@ -11,7 +11,7 @@ module.exports.setup = (app) ->
|
|||
parts = module.split('/')
|
||||
module = parts[0]
|
||||
return getSchema(req, res, module) if parts[1] is 'schema'
|
||||
return errors.unauthorized(res, 'Must have an identity to do anything with the db.') unless req.user
|
||||
return errors.unauthorized(res, 'Must have an identity to do anything with the db. Do you have cookies enabled?') unless req.user
|
||||
|
||||
try
|
||||
moduleName = module.replace '.', '_'
|
||||
|
|
Loading…
Add table
Reference in a new issue