Skip to content

Commit

Permalink
refactor(admin): replace RSVP uses which have direct native Promise e…
Browse files Browse the repository at this point in the history
…quivalents
  • Loading branch information
lego-technix committed Dec 17, 2024
1 parent fd7d1d8 commit ed1d756
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions admin/app/authenticators/oidc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import BaseAuthenticator from 'ember-simple-auth/authenticators/base';
import fetch from 'fetch';
import ENV from 'pix-admin/config/environment';
import { decodeToken } from 'pix-admin/helpers/jwt';
import RSVP from 'rsvp';

export default class OidcAuthenticator extends BaseAuthenticator {
@service session;
Expand Down Expand Up @@ -47,7 +46,7 @@ export default class OidcAuthenticator extends BaseAuthenticator {

const data = await response.json();
if (!response.ok) {
return RSVP.reject(data);
return Promise.reject(data);
}

const decodedAccessToken = decodeToken(data.access_token);
Expand All @@ -61,7 +60,7 @@ export default class OidcAuthenticator extends BaseAuthenticator {
}

restore(data) {
return new RSVP.Promise((resolve, reject) => {
return new Promise((resolve, reject) => {
if (!isEmpty(data['access_token'])) {
resolve(data);
}
Expand Down

0 comments on commit ed1d756

Please sign in to comment.