fix: 🐛 Session setup method deprecation message (#1374)

* fix: 🐛 Session setup method deprecation message
This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2022-10-17 14:57:30 +02:00
1 parent 57dd1ac4d3
commit 18325e5126
5 files changed
+14 -3

No files matched your search

+4 -1
View File
@@ -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,
},
});
/*
+2 -1
View File
@@ -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);
}
+3
View File
@@ -8,6 +8,9 @@ module.exports = function (defaults) {
'ember-cli-babel': {
includeExternalHelpers: true,
},
'ember-simple-auth': {
useSessionSetupMethod: true,
},
babel: {
sourceMaps: 'inline',
},
+2 -1
View File
@@ -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();
+3
View File
@@ -8,6 +8,9 @@ module.exports = function (defaults) {
'ember-cli-babel': {
includeExternalHelpers: true,
},
'ember-simple-auth': {
useSessionSetupMethod: true,
},
babel: {
sourceMaps: 'inline',
},