mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 00:40:56 -05:00
Changed UDID to identifierForVendor
This commit is contained in:
parent
a18537b065
commit
f84e92595b
4 changed files with 7 additions and 7 deletions
|
@ -50,7 +50,7 @@ visa = c.shortString
|
|||
|
||||
_.extend UserSchema.properties,
|
||||
email: c.shortString({title: 'Email', format: 'email'})
|
||||
iosUDID: c.shortString({format: 'hidden'})
|
||||
iosIdentifierForVendor: c.shortString({format: 'hidden'})
|
||||
firstName: c.shortString({title: 'First Name'})
|
||||
lastName: c.shortString({title: 'Last Name'})
|
||||
gender: {type: 'string', 'enum': ['male', 'female']}
|
||||
|
|
|
@ -17,8 +17,8 @@ module.exports.setup = (app) ->
|
|||
(username, password, done) ->
|
||||
|
||||
# kind of a hacky way to make it possible for iPads to 'log in' with their unique device id
|
||||
if username.length is 40 and '@' not in username # must be a UDID
|
||||
q = { iosUDID: username }
|
||||
if username.length is 36 and '@' not in username # must be an identifier for vendor
|
||||
q = { iosIdentifierForVendor: username }
|
||||
else
|
||||
q = { emailLower: username.toLowerCase() }
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ UserSchema.statics.editableProperties = [
|
|||
'firstName', 'lastName', 'gender', 'facebookID', 'gplusID', 'emails',
|
||||
'testGroupNumber', 'music', 'hourOfCode', 'hourOfCodeComplete', 'preferredLanguage',
|
||||
'wizard', 'aceConfig', 'autocastDelay', 'lastLevel', 'jobProfile', 'savedEmployerFilterAlerts',
|
||||
'heroConfig', 'iosUDID'
|
||||
'heroConfig', 'iosIdentifierForVendor'
|
||||
]
|
||||
|
||||
UserSchema.plugin plugins.NamedPlugin
|
||||
|
|
|
@ -22,7 +22,7 @@ describe '/auth/login', ->
|
|||
throw err if err
|
||||
done()
|
||||
|
||||
it 'allows logging in by iosUDID', (done) ->
|
||||
it 'allows logging in by iosIdentifierForVendor', (done) ->
|
||||
req = request.post(getURL('/db/user'),
|
||||
(error, response) ->
|
||||
expect(response).toBeDefined()
|
||||
|
@ -32,11 +32,11 @@ describe '/auth/login', ->
|
|||
done()
|
||||
)
|
||||
form = req.form()
|
||||
form.append('username', '0123456789012345678901234567890123456789')
|
||||
form.append('username', '012345678901234567890123456789012345')
|
||||
form.append('password', '12345')
|
||||
)
|
||||
form = req.form()
|
||||
form.append('iosUDID', '0123456789012345678901234567890123456789')
|
||||
form.append('iosIdentifierForVendor', '012345678901234567890123456789012345')
|
||||
form.append('password', '12345')
|
||||
|
||||
it 'clears Users', (done) ->
|
||||
|
|
Loading…
Reference in a new issue