From ff3204cc910ebe60273653842d4d06739f701844 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 20 Nov 2023 13:27:00 +0000 Subject: [PATCH] DEV: Update auth-complete to use public router service (#24436) `router:main` is private and has an unstable API (e.g. the `didTransition` event does not fire in Ember 5) --- .../discourse/app/instance-initializers/auth-complete.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.js b/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.js index cc52cae53b7..b1685b5f733 100644 --- a/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.js +++ b/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.js @@ -37,8 +37,8 @@ export default { } if (lastAuthResult) { - const router = owner.lookup("router:main"); - router.one("didTransition", () => { + const router = owner.lookup("service:router"); + router.one("routeDidChange", () => { next(() => { const options = JSON.parse(lastAuthResult); @@ -46,7 +46,7 @@ export default { return; } - if (router.currentPath === "invites.show") { + if (router.currentRouteName === "invites.show") { owner .lookup("controller:invites-show") .authenticationComplete(options);