Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove most v1.0.0 deprecations #500

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions addon/utils/cognito-storage.js

This file was deleted.

82 changes: 0 additions & 82 deletions addon/utils/cognito-user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Promise } from 'rsvp';
import EmberObject, { computed } from '@ember/object';
import { readOnly } from '@ember/object/computed';
import { deprecate } from '@ember/debug';
import { normalizeAttributes } from './utils';

//
@@ -35,41 +34,6 @@ export default class CognitoUser extends EmberObject {
return auth.changePassword(user, oldPassword, newPassword);
}

confirmPassword(verificationCode, newPassword) {
deprecate(
'This functionality has moved to forgotPasswordSubmit() on the Cognito service.',
false,
{
for: 'ember-cognito',
id: 'ember-cognito-confirm-password',
since: '0.12.0',
until: '1.0.0',
}
);

const { auth, username } = this;
return auth.forgotPasswordSubmit(username, verificationCode, newPassword);
}

confirmRegistration(confirmationCode, forceAliasCreation) {
deprecate(
'This functionality has moved to confirmSignUp() on the Cognito service.',
false,
{
for: 'ember-cognito',
id: 'ember-cognito-confirm-registration',
since: '0.12.0',
until: '1.0.0',
}
);

const { auth, username } = this;
const options = forceAliasCreation
? { forceAliasCreation: true }
: undefined;
return auth.confirmSignUp(username, confirmationCode, options);
}

deleteAttributes(attributeList) {
return this._callback('deleteAttributes', attributeList);
}
@@ -78,22 +42,6 @@ export default class CognitoUser extends EmberObject {
return this._callback('deleteUser');
}

forgotPassword() {
deprecate(
'This functionality has moved to forgotPassword() on the Cognito service.',
false,
{
for: 'ember-cognito',
id: 'ember-cognito-forgot-password',
since: '0.12.0',
until: '1.0.0',
}
);

const { auth, username } = this;
return auth.forgotPassword(username);
}

getAttributeVerificationCode(attributeName) {
const { auth, user } = this;
return auth.verifyUserAttribute(user, attributeName);
@@ -114,22 +62,6 @@ export default class CognitoUser extends EmberObject {
return normalizeAttributes(result, false);
}

resendConfirmationCode() {
deprecate(
'This functionality has moved to resendSignUp() on the Cognito service.',
false,
{
for: 'ember-cognito',
id: 'ember-cognito-resend-confirmation-code',
since: '0.12.0',
until: '1.0.0',
}
);

const { auth, username } = this;
return auth.resendSignUp(username);
}

signOut() {
return this.auth.signOut();
}
@@ -155,18 +87,4 @@ export default class CognitoUser extends EmberObject {
let payload = session.getIdToken().payload || {};
return payload['cognito:groups'] || [];
}

getStorageData() {
deprecate(
'getStorageData() no longer used, and always returns an empty object.',
false,
{
for: 'ember-cognito',
id: 'ember-cognito-get-storage-data',
since: '0.12.0',
until: '1.0.0',
}
);
return {};
}
}
21 changes: 0 additions & 21 deletions tests/unit/utils/cognito-storage-test.js

This file was deleted.

56 changes: 0 additions & 56 deletions tests/unit/utils/cognito-user-test.js
Original file line number Diff line number Diff line change
@@ -34,36 +34,6 @@ module('Unit | Utility | cognito user', function (hooks) {
await user.changePassword('oldpass', 'newpass');
});

test('confirmPassword', async function (assert) {
assert.expect(3);

const auth = MockAuth.extend({
forgotPasswordSubmit(username, verificationCode, newPassword) {
assert.strictEqual(username, 'testuser');
assert.strictEqual(verificationCode, '1234');
assert.strictEqual(newPassword, 'newpass');
},
}).create();

const user = CognitoUser.create({ auth, user: newUser('testuser') });
await user.confirmPassword('1234', 'newpass');
});

test('confirmRegistration', async function (assert) {
assert.expect(3);

const auth = MockAuth.extend({
confirmSignUp(username, confirmationCode, options) {
assert.strictEqual(username, 'testuser');
assert.strictEqual(confirmationCode, '1234');
assert.deepEqual(options, { forceAliasCreation: true });
},
}).create();

const user = CognitoUser.create({ auth, user: newUser('testuser') });
await user.confirmRegistration('1234', true);
});

test('deleteAttributes', async function (assert) {
assert.expect(1);

@@ -88,19 +58,6 @@ module('Unit | Utility | cognito user', function (hooks) {
assert.strictEqual(text, 'SUCCESS');
});

test('forgotPassword', async function (assert) {
assert.expect(1);

const auth = MockAuth.extend({
forgotPassword(username) {
assert.strictEqual(username, 'testuser');
},
}).create();

const user = CognitoUser.create({ auth, user: newUser('testuser') });
await user.forgotPassword();
});

test('getAttributeVerificationCode', async function (assert) {
assert.expect(2);

@@ -182,19 +139,6 @@ module('Unit | Utility | cognito user', function (hooks) {
});
});

test('resendConformationCode', async function (assert) {
assert.expect(1);

const auth = MockAuth.extend({
resendSignUp(username) {
assert.strictEqual(username, 'testuser');
},
}).create();

const user = CognitoUser.create({ auth, user: newUser('testuser') });
await user.resendConfirmationCode();
});

test('updateAttributes', async function (assert) {
assert.expect(4);