Accounts-ui loginButtons: configuring a redirect target after successful sign-in
0 reputation · 16 Mar 2020, 12:56 UTC
Goal
I am using Meteor's accounts-ui package with the built-in {{> loginButtons}} template in an application that also uses accounts-password. After a user signs in, I want them sent to a specific route (for example a dashboard) rather than staying on the page where the login dropdown was rendered.
Constraint
From the documented API, Accounts.ui.config() exposes options like passwordSignupFields and requestPermissions, but I cannot find a documented option that controls post-login navigation. The template appears to manage only its own dropdown state, and routing is left entirely to the application. I would prefer to avoid replacing the whole template with custom Blaze markup just to get a redirect.
Assume Meteor 2.x with Blaze and a client-side router such as ostrio:flow-router-extra or kadira:flow-router. I am unsure whether the intended integration point is a login callback, a router-level trigger, or template override, and whether behavior differs between accounts-ui and the lower-level accounts-base API.
Questions
- Is there any supported configuration in
accounts-uifor a post-login redirect, or isAccounts.onLoginon the client the documented integration point? - If
Accounts.onLoginis used, does it fire reliably for password, resume-token, and OAuth logins alike? - Are there known pitfalls when redirecting inside the callback while the login method's own callback is still pending?