Skip to content

Commit

Permalink
refactor(mon-pix): use session helper in campaings code page
Browse files Browse the repository at this point in the history
  • Loading branch information
bpetetot committed Dec 9, 2024
1 parent 3a91ce4 commit 808c9b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions mon-pix/app/controllers/fill-in-campaign-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class FillInCampaignCodeController extends Controller {
}

get isUserAuthenticatedByGAR() {
return !!this.session.get('data.externalUser');
return this.session.isAuthenticatedByGar;
}

get firstTitle() {
Expand Down Expand Up @@ -74,8 +74,7 @@ export default class FillInCampaignCodeController extends Controller {
filter: { code: campaignCode },
});
const isGARCampaign = this.campaign.identityProvider === IDENTITY_PROVIDER_ID_GAR;
const isUserAuthenticatedByGAR = this.session.get('data.externalUser');
if (_shouldShowGARModal(isGARCampaign, isUserAuthenticatedByGAR, this.isUserAuthenticatedByPix)) {
if (_shouldShowGARModal(isGARCampaign, this.isUserAuthenticatedByGAR, this.isUserAuthenticatedByPix)) {
this.showGARModal = true;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion mon-pix/app/routes/fill-in-campaign-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class FillInCampaignCodeRoute extends Route {

beforeModel(transition) {
if (transition.to.queryParams.externalUser) {
this.session.data.externalUser = transition.to.queryParams.externalUser;
this.session.externalUserTokenFromGar = transition.to.queryParams.externalUser;
}
}

Expand Down

0 comments on commit 808c9b9

Please sign in to comment.