Skip to content

Commit

Permalink
Merge pull request #153 from BobrImperator/refactor-remove-assign-usage
Browse files Browse the repository at this point in the history
refactor: remove deprecated Ember.assign in favor of Object.assign
  • Loading branch information
paulcwatts committed Jul 31, 2020
2 parents 37df03c + cfa9282 commit a62ba6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions addon-test-support/utils/-mock-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import {
CognitoRefreshToken,
CognitoUserSession
} from "amazon-cognito-identity-js";
import { assign } from '@ember/polyfills';

// Makes a JWT from a payload
export function makeToken({ duration = 1000, header = 'header', extra = {} } = {}) {
const now = Math.floor(new Date() / 1000);
// To get a non-zero clock drift.
const iat = now - 123;
const payload = assign({
const payload = Object.assign({
iat,
exp: iat + duration
}, extra);
Expand Down
3 changes: 1 addition & 2 deletions addon/services/cognito.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Service, { inject as service } from '@ember/service';
import { assign } from '@ember/polyfills';
import CognitoUser from '../utils/cognito-user';
import { normalizeAttributes } from "../utils/utils";
import Auth from "@aws-amplify/auth";
Expand Down Expand Up @@ -27,7 +26,7 @@ export default Service.extend({
*/
configure(awsconfig) {
const { poolId, clientId } = this.getProperties('poolId', 'clientId');
const params = assign({
const params = Object.assign({
userPoolId: poolId,
userPoolWebClientId: clientId,
}, awsconfig);
Expand Down
3 changes: 1 addition & 2 deletions app/services/cognito.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import CognitoService from 'ember-cognito/services/cognito';
import ENV from '../config/environment';
import { assign } from '@ember/polyfills';

const cognitoEnv = assign({
const cognitoEnv = Object.assign({
autoRefreshSession: false
}, ENV.cognito);

Expand Down

0 comments on commit a62ba6c

Please sign in to comment.