mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed more tests
refs 8630be5a87
- referenced commit skipped current user and proxy service population when `skipAuthSuccessHandler` was set but the population is needed during setup
- `skipAuthSuccessHandler` is used for skipping the post-authentication transition rather than skipping all post-auth behaviour so the the post-auth behaviour was reintroduced but put in a guard so we don't try to do it again when it's already been run
This commit is contained in:
parent
a7dc63cfab
commit
9bc799258d
1 changed files with 10 additions and 8 deletions
|
@ -56,19 +56,21 @@ export default class SessionService extends ESASessionService {
|
|||
}
|
||||
|
||||
async handleAuthentication() {
|
||||
if (!this.user) {
|
||||
try {
|
||||
await this.populateUser();
|
||||
} catch (err) {
|
||||
await this.invalidate();
|
||||
}
|
||||
|
||||
await this.postAuthPreparation();
|
||||
}
|
||||
|
||||
if (this.skipAuthSuccessHandler) {
|
||||
this.skipAuthSuccessHandler = false;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.populateUser();
|
||||
} catch (err) {
|
||||
await this.invalidate();
|
||||
}
|
||||
|
||||
await this.postAuthPreparation();
|
||||
|
||||
super.handleAuthentication('home');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue