Skip to content

Commit ee28582

Browse files
chore(deps-dev): bump ember-simple-auth-token from 3.0.0 to 4.0.7 (#3886)
* chore(deps-dev): bump ember-simple-auth-token from 3.0.0 to 4.0.7 Bumps [ember-simple-auth-token](https://github.com/jpadilla/ember-simple-auth-token) from 3.0.0 to 4.0.7. - [Release notes](https://github.com/jpadilla/ember-simple-auth-token/releases) - [Commits](fenichelar/ember-simple-auth-token@v3.0.0...v4.0.7) Signed-off-by: dependabot-preview[bot] <[email protected]> Co-authored-by: Areeb Jamal <[email protected]>
1 parent 2b72693 commit ee28582

File tree

8 files changed

+50
-31
lines changed

8 files changed

+50
-31
lines changed

app/components/account/application-section.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export default Component.extend({
1515
this.loader.load(`/auth/oauth/login/${ provider }/${ authData.authorizationCode }/?redirect_uri=${ authData.redirectUri}`)
1616
.then(async response => {
1717
let credentials = {
18-
'identification' : response.email,
19-
'password' : response.facebook_login_hash
18+
'username' : response.email,
19+
'password' : response.facebook_login_hash
2020
};
2121

2222
let authenticator = 'authenticator:jwt';

app/components/forms/login-form.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class extends Component.extend(FormMixin) {
4444
@action
4545
async submit() {
4646
this.onValid(async() => {
47-
let credentials = { identification: this.identification, password: this.password },
47+
let credentials = { username: this.identification, password: this.password },
4848
authenticator = 'authenticator:jwt';
4949
this.setProperties({
5050
errorMessage : null,
@@ -60,8 +60,8 @@ export default class extends Component.extend(FormMixin) {
6060

6161
}
6262
} catch (e) {
63-
if (e.error) {
64-
this.set('errorMessage', this.l10n.tVar(e.error));
63+
if (e.json && e.json.error) {
64+
this.set('errorMessage', this.l10n.tVar(e.json.error));
6565
} else {
6666
this.set('errorMessage', this.l10n.t('An unexpected error occurred.'));
6767
}

app/controllers/oauth/callback.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export default Controller.extend({
55
this.loader.post(`/auth/oauth/login/${ queryParams.provider }?code=${ queryParams.code }`)
66
.then(response => {
77
let credentials = {
8-
identification : response.email,
9-
password : response.oauth_hash
8+
username : response.email,
9+
password : response.oauth_hash
1010
},
1111
authenticator = 'authenticator:jwt';
1212

app/controllers/public/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default Controller.extend({
2929
.then(() => {
3030
let credentials = newUser.getProperties('email', 'password'),
3131
authenticator = 'authenticator:jwt';
32-
credentials.identification = newUser.email;
32+
credentials.username = newUser.email;
3333
this.session
3434
.authenticate(authenticator, credentials)
3535
.then(async() => {
@@ -63,10 +63,10 @@ export default Controller.extend({
6363

6464
},
6565

66-
async loginExistingUser(identification, password) {
66+
async loginExistingUser(username, password) {
6767
this.set('isLoading', true);
6868
let credentials = {
69-
identification,
69+
username,
7070
password
7171
};
7272
let authenticator = 'authenticator:jwt';
@@ -83,7 +83,7 @@ export default Controller.extend({
8383
})
8484
.catch(reason => {
8585
if (!(this.isDestroyed || this.isDestroying)) {
86-
if (reason && Object.prototype.hasOwnProperty.call(reason, 'status_code') && reason.status_code === 401) {
86+
if (reason && reason.status === 401) {
8787
this.set('errorMessage', this.l10n.t('Your credentials were incorrect.'));
8888
} else {
8989
this.set('errorMessage', this.l10n.t('An unexpected error occurred.'));

app/controllers/register.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ export default Controller.extend({
3636
});
3737
},
3838

39-
async loginExistingUser(identification, password, token, eventId) {
39+
async loginExistingUser(username, password, token, eventId) {
4040
this.set('isLoading', true);
4141
let credentials = {
42-
identification,
42+
username,
4343
password
4444
};
4545
let authenticator = 'authenticator:jwt';

config/environment.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,11 @@ module.exports = function(environment) {
102102
};
103103

104104
ENV['ember-simple-auth-token'] = {
105-
refreshAccessTokens : false,
106-
serverTokenEndpoint : `${ENV.APP.apiHost}/auth/session`,
107-
identificationField : 'email',
108-
passwordField : 'password',
109-
tokenPropertyName : 'access_token',
110-
refreshTokenPropertyName : 'refresh_token',
111-
authorizationPrefix : 'JWT ',
112-
authorizationHeaderName : 'Authorization',
113-
headers : {}
105+
refreshAccessTokens : false,
106+
serverTokenEndpoint : `${ENV.APP.apiHost}/auth/session`,
107+
tokenPropertyName : 'access_token',
108+
authorizationPrefix : 'JWT ',
109+
authorizationHeaderName: 'Authorization'
114110
};
115111

116112
ENV['g-map'] = {
@@ -211,6 +207,8 @@ module.exports = function(environment) {
211207
ENV['simple-auth'] = {
212208
store: 'simple-auth-session-store:ephemeral'
213209
};
210+
211+
ENV['ember-simple-auth-token'].tokenExpirationInvalidateSession = false;
214212
}
215213

216214
if (environment === 'production') {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"ember-router-scroll": "DockYard/ember-router-scroll#695d894",
104104
"ember-scroll-to": "^0.6.5",
105105
"ember-simple-auth": "^2.1.1",
106-
"ember-simple-auth-token": "^3.0.0",
106+
"ember-simple-auth-token": "^4.0.7",
107107
"ember-source": "~3.16.0",
108108
"ember-table": "^2.2.3",
109109
"ember-truth-helpers": "^2.1.0",

yarn.lock

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6812,9 +6812,10 @@ [email protected]:
68126812
node-fetch "^2.6.0"
68136813
whatwg-fetch "^3.0.0"
68146814

6815-
"ember-fetch@^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0":
6816-
version "6.5.1"
6817-
resolved "https://registry.yarnpkg.com/ember-fetch/-/ember-fetch-6.5.1.tgz#6512153b9b85042744ed5a7934c8edb4a5b02dd0"
6815+
"ember-fetch@^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "ember-fetch@^4.0.0 || ^5.0.0 || ^6.0.0":
6816+
version "6.7.2"
6817+
resolved "https://registry.yarnpkg.com/ember-fetch/-/ember-fetch-6.7.2.tgz#82efce4a55a64863104347b71e598208b9acf518"
6818+
integrity sha512-+Dd++MJVkCXoqX2DPtFDjuoDMcLk+7fphLq7D8OoXwJq9KQMTff07sH18qhxWXV5Hqknvz3Uwy214g54vOboag==
68186819
dependencies:
68196820
abortcontroller-polyfill "^1.3.0"
68206821
broccoli-concat "^3.2.2"
@@ -6826,7 +6827,7 @@ [email protected]:
68266827
calculate-cache-key-for-tree "^2.0.0"
68276828
caniuse-api "^3.0.0"
68286829
ember-cli-babel "^6.8.2"
6829-
node-fetch "^2.3.0"
6830+
node-fetch "^2.6.0"
68306831
whatwg-fetch "^3.0.0"
68316832

68326833
ember-fullcalendar@^1.8.0:
@@ -7146,11 +7147,31 @@ ember-scroll-to@^0.6.5:
71467147
ember-cli-babel "^6.3.0"
71477148
ember-cli-htmlbars "^2.0.1"
71487149

7149-
ember-simple-auth-token@^3.0.0:
7150-
version "3.0.0"
7151-
resolved "https://registry.yarnpkg.com/ember-simple-auth-token/-/ember-simple-auth-token-3.0.0.tgz#5641c543a9ac5dfa42ce6100296e144aa40742a9"
7150+
ember-simple-auth-token@^4.0.7:
7151+
version "4.0.7"
7152+
resolved "https://registry.yarnpkg.com/ember-simple-auth-token/-/ember-simple-auth-token-4.0.7.tgz#df4177d118b9f7a75a3879ceec04ab2c55e1cad2"
7153+
integrity sha512-1AyyBn0Bvmf4l0N1/ElR7bkP6T71+uU1H5qkCDqrOV1cM1o378/vx0MPtw0nLU0OM9/H6M+TNWyyR143MjcXfA==
71527154
dependencies:
71537155
ember-cli-babel "^6.6.0"
7156+
ember-fetch "^4.0.0 || ^5.0.0 || ^6.0.0"
7157+
ember-get-config "^0.2.4"
7158+
ember-simple-auth "^1.6.0"
7159+
7160+
ember-simple-auth@^1.6.0:
7161+
version "1.9.2"
7162+
resolved "https://registry.yarnpkg.com/ember-simple-auth/-/ember-simple-auth-1.9.2.tgz#ee8b1b0ec4c5c0e08bc94560cb90552d4ae7fd5d"
7163+
integrity sha512-WTG2uGe8+TIfwsy5eaS7uIszEmyQ/pjKLUMjyq6YYkU9d9erSXVRiuO4h46OxTEbVI3c17mjAu/4kTxc+BOFZw==
7164+
dependencies:
7165+
base-64 "^0.1.0"
7166+
broccoli-file-creator "^2.0.0"
7167+
broccoli-funnel "^1.2.0 || ^2.0.0"
7168+
broccoli-merge-trees "^2.0.0 || ^3.0.0"
7169+
ember-cli-babel "^6.8.2"
7170+
ember-cli-is-package-missing "^1.0.0"
7171+
ember-cookies "^0.3.0 || ^0.4.0"
7172+
ember-fetch "^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0"
7173+
ember-getowner-polyfill "^1.1.0 || ^2.0.0"
7174+
silent-error "^1.0.0"
71547175

71557176
ember-simple-auth@^2.1.1:
71567177
version "2.1.1"
@@ -11838,7 +11859,7 @@ node-fetch-npm@^2.0.2:
1183811859
json-parse-better-errors "^1.0.0"
1183911860
safe-buffer "^5.1.1"
1184011861

11841-
node-fetch@^2.3.0, node-fetch@^2.6.0:
11862+
node-fetch@^2.6.0:
1184211863
version "2.6.0"
1184311864
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
1184411865
integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==

0 commit comments

Comments
 (0)