From 37e58c3ab5095af3259ec68199a85b87518f9b42 Mon Sep 17 00:00:00 2001 From: Benjamin Petetot Date: Tue, 10 Dec 2024 17:47:47 +0100 Subject: [PATCH] fix(mon-pix): deconnexion when user GAR authenticated refresh the page --- mon-pix/app/authenticators/gar.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mon-pix/app/authenticators/gar.js b/mon-pix/app/authenticators/gar.js index 0b88a105109..d048bd3e34b 100644 --- a/mon-pix/app/authenticators/gar.js +++ b/mon-pix/app/authenticators/gar.js @@ -1,3 +1,4 @@ +import { isEmpty } from '@ember/utils'; import BaseAuthenticator from 'ember-simple-auth/authenticators/base'; import { decodeToken } from 'mon-pix/helpers/jwt'; import RSVP from 'rsvp'; @@ -13,4 +14,13 @@ export default class GarAuthenticator extends BaseAuthenticator { source, }); } + + restore(data) { + return new RSVP.Promise((resolve, reject) => { + if (!isEmpty(data['access_token'])) { + resolve(data); + } + reject(); + }); + } }