diff --git a/addons/auth/addon/authenticators/password.js b/addons/auth/addon/authenticators/password.js index f4dc5668c..25ba4da1c 100644 --- a/addons/auth/addon/authenticators/password.js +++ b/addons/auth/addon/authenticators/password.js @@ -51,17 +51,14 @@ export default class PasswordAuthenticator extends BaseAuthenticator { * @param {object} creds * @param {string} creds.identification is sent to server as `name` * @param {string} creds.password - * @param {string} authMethodId ID of the auth method to use * @param {boolean} requestCookies request cookie tokens (default `true`) * @return {Promise} */ async authenticate( { identification: name, password }, - authMethodID, requestCookies = true ) { const body = JSON.stringify({ - auth_method_id: authMethodID, token_type: requestCookies ? 'cookie' : null, credentials: { name, password }, }); diff --git a/addons/auth/tests/unit/authenticators/password-test.js b/addons/auth/tests/unit/authenticators/password-test.js index bf516dd43..5ab5d247a 100644 --- a/addons/auth/tests/unit/authenticators/password-test.js +++ b/addons/auth/tests/unit/authenticators/password-test.js @@ -15,7 +15,7 @@ module('Unit | Authenticator | password', function (hooks) { assert.ok(json.token_type, 'Requested token cookies by default'); return new Response(200); }); - await authenticator.authenticate({}, '').then(() => { + await authenticator.authenticate({}).then(() => { assert.ok(true, 'authentication succeeded'); }); }); @@ -28,7 +28,7 @@ module('Unit | Authenticator | password', function (hooks) { assert.notOk(json.token_type, 'Did not request tokens cookies'); return new Response(200); }); - await authenticator.authenticate({}, '', false).then(() => { + await authenticator.authenticate({}, false).then(() => { assert.ok(true, 'authentication succeeded'); }); }); @@ -39,7 +39,6 @@ module('Unit | Authenticator | password', function (hooks) { this.server.post(authenticator.authEndpoint, (schema, request) => { const json = JSON.parse(request.requestBody); assert.deepEqual(json, { - auth_method_id: '123', token_type: 'cookie', credentials: { name: 'foo', @@ -52,8 +51,7 @@ module('Unit | Authenticator | password', function (hooks) { identification: 'foo', password: 'bar', }; - const authMethodID = '123'; - await authenticator.authenticate(creds, authMethodID); + await authenticator.authenticate(creds); }); test('it rejects if the endpoint sends an error status code', async function (assert) {