From 18325e51268910dc8282f5cdf0b39bafc97e5094 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Mon, 17 Oct 2022 14:57:30 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Session=20setup=20method?= =?UTF-8?q?=20deprecation=20message=20(#1374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 Session setup method deprecation message --- addons/auth/ember-cli-build.js | 5 ++++- ui/admin/app/routes/application.js | 3 ++- ui/admin/ember-cli-build.js | 3 +++ ui/desktop/app/routes/application.js | 3 ++- ui/desktop/ember-cli-build.js | 3 +++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/addons/auth/ember-cli-build.js b/addons/auth/ember-cli-build.js index ba0649dc9..48da19086 100644 --- a/addons/auth/ember-cli-build.js +++ b/addons/auth/ember-cli-build.js @@ -4,7 +4,10 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function (defaults) { let app = new EmberAddon(defaults, { - // Add options here + 'ember-simple-auth': { + // https://github.com/mainmatter/ember-simple-auth/blob/master/guides/upgrade-to-v4.md#call-sessionsetup-method-in-your-applicationroute + useSessionSetupMethod: true, + }, }); /* diff --git a/ui/admin/app/routes/application.js b/ui/admin/app/routes/application.js index ef413c97b..c10da153f 100644 --- a/ui/admin/app/routes/application.js +++ b/ui/admin/app/routes/application.js @@ -47,7 +47,8 @@ export default class ApplicationRoute extends Route { }); } - beforeModel() { + async beforeModel() { + await this.session.setup(); const theme = this.session.get('data.theme'); this.toggleTheme(theme); } diff --git a/ui/admin/ember-cli-build.js b/ui/admin/ember-cli-build.js index 475c97184..401b33588 100644 --- a/ui/admin/ember-cli-build.js +++ b/ui/admin/ember-cli-build.js @@ -8,6 +8,9 @@ module.exports = function (defaults) { 'ember-cli-babel': { includeExternalHelpers: true, }, + 'ember-simple-auth': { + useSessionSetupMethod: true, + }, babel: { sourceMaps: 'inline', }, diff --git a/ui/desktop/app/routes/application.js b/ui/desktop/app/routes/application.js index d274a56d7..5d9786bba 100644 --- a/ui/desktop/app/routes/application.js +++ b/ui/desktop/app/routes/application.js @@ -24,7 +24,8 @@ export default class ApplicationRoute extends Route { * reported by the main process. If they differ, update the main process * clusterUrl so that the renderer's CSP can be rewritten to allow requests. */ - beforeModel() { + async beforeModel() { + await this.session.setup(); const theme = this.session.get('data.theme'); this.toggleTheme(theme); return this.clusterUrl.updateClusterUrl(); diff --git a/ui/desktop/ember-cli-build.js b/ui/desktop/ember-cli-build.js index d66f1f5c0..426a30736 100644 --- a/ui/desktop/ember-cli-build.js +++ b/ui/desktop/ember-cli-build.js @@ -8,6 +8,9 @@ module.exports = function (defaults) { 'ember-cli-babel': { includeExternalHelpers: true, }, + 'ember-simple-auth': { + useSessionSetupMethod: true, + }, babel: { sourceMaps: 'inline', },