diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-03 14:10:36 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-03 14:10:36 -0400 |
commit | 87989b8afd4666a72940389db716b6500d0a9ec3 (patch) | |
tree | d4b0270eb4a9adbff0dd1b6f527ddcccbc9a83d9 /webapp/tests | |
parent | e76a30bca0690bad53a4cabd6c7c629e89c17268 (diff) | |
download | chat-87989b8afd4666a72940389db716b6500d0a9ec3.tar.gz chat-87989b8afd4666a72940389db716b6500d0a9ec3.tar.bz2 chat-87989b8afd4666a72940389db716b6500d0a9ec3.zip |
PLT-2258 Unified login screen and related APIs (#2820)
* Unified login screen and related APIs
* Refactored login API call to be less convoluted
* Removed LDAP login prompt from invite process
* Fixed existing LDAP users being able to log in if LDAP was configured, but disabled
* Gofmt
* Future proofed login API
* Updated login APIs based on feedback
* Added additional auditing to login API
* Actually removed loginById
Diffstat (limited to 'webapp/tests')
-rw-r--r-- | webapp/tests/client_user.test.jsx | 19 | ||||
-rw-r--r-- | webapp/tests/test_helper.jsx | 1 |
2 files changed, 9 insertions, 11 deletions
diff --git a/webapp/tests/client_user.test.jsx b/webapp/tests/client_user.test.jsx index e0ead2de9..7835a38bf 100644 --- a/webapp/tests/client_user.test.jsx +++ b/webapp/tests/client_user.test.jsx @@ -66,7 +66,6 @@ describe('Client.User', function() { function() { client.login( user.email, - null, user.password, null, function(data) { @@ -85,15 +84,15 @@ describe('Client.User', function() { ); }); - it('loginByUsername', function(done) { + it('loginById', function(done) { var client = TestHelper.createClient(); var user = TestHelper.fakeUser(); client.createUser( user, - function() { - client.login( - null, - user.username, + function(newUser) { + assert.equal(user.email, newUser.email); + client.loginById( + newUser.id, user.password, null, function(data) { @@ -112,14 +111,14 @@ describe('Client.User', function() { ); }); - it('loginByLdap', function(done) { + it('loginByUsername', function(done) { var client = TestHelper.createClient(); client.enableLogErrorsToConsole(false); // Disabling since this unit test causes an error var user = TestHelper.fakeUser(); client.createUser( user, function() { - client.loginByLdap( + client.login( user.username, user.password, null, @@ -127,7 +126,8 @@ describe('Client.User', function() { done(new Error()); }, function(err) { - assert.equal(err.id, 'api.user.login_ldap.disabled.app_error'); + // should error out because logging in by username is disabled by default + assert.equal(err.id, 'store.sql_user.get_for_login.app_error'); done(); } ); @@ -372,7 +372,6 @@ describe('Client.User', function() { it('checkMfa', function(done) { TestHelper.initBasic(() => { TestHelper.basicClient().checkMfa( - 'email', TestHelper.generateId(), function(data) { assert.equal(data.mfa_required, 'false'); diff --git a/webapp/tests/test_helper.jsx b/webapp/tests/test_helper.jsx index 385279360..f19d96433 100644 --- a/webapp/tests/test_helper.jsx +++ b/webapp/tests/test_helper.jsx @@ -128,7 +128,6 @@ class TestHelperClass { outer.basicClient().setTeamId(outer.basict.id); outer.basicClient().login( rteamSignup.user.email, - null, password, null, function() { |