diff --git a/ui/core/app/routes/application.js b/ui/core/app/routes/application.js index 0874bb7f0..0a6c58271 100644 --- a/ui/core/app/routes/application.js +++ b/ui/core/app/routes/application.js @@ -60,14 +60,19 @@ export default class ApplicationRoute extends Route.extend( this.session.invalidate(); } + /** + * Invalidates the session if a 401 error occurs and returns false to + * prevent further error handling. + * Returns true in all other cases, allowing error handling to occur (such + * as displaying the `error.hbs` template, if one exists). + */ @action error(e) { const isUnauthenticated = e?.errors[0]?.isUnauthenticated; if (isUnauthenticated) { this.session.invalidate(); return false; - } else { - return true; } + return true; } }