-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ember-simple-auth a peerDep, drop support for node < 14 (#454)
* Make ember-simple-auth a peerDep * ember-cli-update to 4.8.1, drop support for node < 14 * Update .template-lintrc.js * Add @ember/string to devDeps * yarn upgrade * Update ember-try.js * Update ESA to use session setup
- Loading branch information
1 parent
5517c12
commit 74b75c5
Showing
19 changed files
with
3,498 additions
and
4,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,6 @@ | |
/package.json.ember-try | ||
/package-lock.json.ember-try | ||
/yarn.lock.ember-try | ||
|
||
# broccoli-debug | ||
/DEBUG/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodejs 18.19.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
/* eslint-disable ember/no-mixins */ | ||
import { inject as service } from '@ember/service'; | ||
import Route from '@ember/routing/route'; | ||
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin'; | ||
|
||
export default Route.extend(ApplicationRouteMixin, { | ||
currentUser: service(), | ||
|
||
beforeModel() { | ||
return this._loadCurrentUser(); | ||
}, | ||
import { inject as service } from '@ember/service'; | ||
|
||
sessionAuthenticated() { | ||
this._super(...arguments); | ||
this._loadCurrentUser(); | ||
}, | ||
export default class Application extends Route { | ||
@service currentUser; | ||
@service session; | ||
|
||
_loadCurrentUser() { | ||
return this.currentUser.load().catch(() => this.session.invalidate()); | ||
}, | ||
}); | ||
async beforeModel() { | ||
await this.session.setup(); | ||
try { | ||
await this.currentUser.load(); | ||
} catch (err) { | ||
await this.invalidate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { inject as service } from '@ember/service'; | ||
import BaseSessionService from 'ember-simple-auth/services/session'; | ||
|
||
export default class SessionService extends BaseSessionService { | ||
@service currentUser; | ||
|
||
async handleAuthentication() { | ||
super.handleAuthentication(...arguments); | ||
|
||
try { | ||
await this.currentUser.load(); | ||
} catch (err) { | ||
await this.invalidate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.