Approach for App Entry Point


#1

Hello to all,

I’m using Flow Router, Blaze Layout.

I need my app entry point to first check user is logged in or not.

One LAYOUT for non-login user and another LAYOUT for logged in user.

After read Flow Router and Blaze Layout documentation, I have no idea how to handle this situation since Flow Router do not recommend to check user status in Flow Router ACTION.

{{#if statement}}
  {{> Layout1}}
{{else}}
  {{> Layout2}}
{{/if}}

If I put the above into my entry point HTML, where should I render the LAYOUT and TEMPLATE?

BlazeLayout.render('Layout1', { top: "Template1", main: "Component1" });

or

BlazeLayout.render('Layout2', { top: "Template2", main: "Component2" });

In that case, what is the proper way to achieve what I need? Please advice, thank you.