diff --git a/app/templates/login.hbs b/app/templates/login.hbs index d4a4546..18d24ef 100644 --- a/app/templates/login.hbs +++ b/app/templates/login.hbs @@ -9,7 +9,7 @@ {{else}}

Log In

- {{input value=identification type="text" placeholder="Username"}} + {{input value=identification type="text" placeholder="Email"}} {{input value=password type="password" placeholder="Password"}} {{input class="button-gray" type="submit" value="Log In"}}
diff --git a/config/environment.js b/config/environment.js index c9c1b9e..45053b2 100644 --- a/config/environment.js +++ b/config/environment.js @@ -31,7 +31,7 @@ module.exports = function(environment) { } ENV['simple-auth-token'] = { serverTokenEndpoint: '/api/authenticate', - identificationField: 'username', + identificationField: 'email', passwordField: 'password', tokenPropertyName: 'token', authorizationPrefix: 'Bearer ', @@ -61,7 +61,7 @@ module.exports = function(environment) { } ENV['simple-auth-token'] = { serverTokenEndpoint: 'https://bactdb-test.herokuapp.com/api/authenticate', - identificationField: 'username', + identificationField: 'email', passwordField: 'password', tokenPropertyName: 'token', authorizationPrefix: 'Bearer ', @@ -95,7 +95,7 @@ module.exports = function(environment) { } ENV['simple-auth-token'] = { serverTokenEndpoint: 'https://bactdb.herokuapp.com/api/authenticate', - identificationField: 'username', + identificationField: 'email', passwordField: 'password', tokenPropertyName: 'token', authorizationPrefix: 'Bearer ', diff --git a/server/mocks/authenticate.js b/server/mocks/authenticate.js index 764e66d..544bf59 100644 --- a/server/mocks/authenticate.js +++ b/server/mocks/authenticate.js @@ -8,15 +8,15 @@ module.exports = function(app) { var ms = 3000 + new Date().getTime(); while (new Date() < ms){} - if (req.body.username === 'test' && req.body.password === 'test') { + if (req.body.email === 'test' && req.body.password === 'test') { var token = jwt.sign({ 'name': 'Test User', - 'role': 'admin' + 'role': 'A' }, 'secret', { expiresInMinutes: 60, issuer: 'bactdb', - subject: 'Test User', + subject: 'test', }); res.send({ 'token': token