A Pattern for FlowRouter Auth

Adrian Lanning

 

adrian@share911.com

https://github.com/alanning/

 

 

Oct. 22, 2015

Setting the scene

Credit:  Jacob Surland    http://caughtinpixels.com/

IronRouter FlowRouter
Yes No
Can Must
✓ 
More

Meteor Routers

Allows Reactivity
Performance
Easy to get started
Package support

Authentication

Who are you?

 

Packages:  Accounts (core)

Authorization

What can you do?

 

Packages:  Roles (community)

Access Control

Meteor Auth Sequence

IronRouter

Template-based, or

 

Directly in route

FlowRouter

Must use template-based

 

 

* But Before Triggers, right? No!

"In FR, triggers based auth does not wait. Template based is the only way." - Arunoda

A&A with Routers

Simple Demo

Route-based vs Template-based

FlowRouter Guide

Manage Users Layout

Simple pattern

Component 3

Component 4

(authenticated & authorized)

Header

Public Layout

Marketing Copy

Login Form

(not logged in)

Header

Main Layout

Component 1

Component 2

(authenticated & authorized)

Header

View Secrets Layout

Component 5

Component 6

(authenticated & authorized)

Header

Component 1

Main Layout (authenticated)

Component 2

Component 3

Advanced pattern

Admin Auth Controller (authorized)

Advanced Auth Demo

* Modular directory structure

* Hierarchy of Templates

* Auth Controllers

* Compose in route

 

Summary

  • Access Control
     
  • Existing methods
     
  • Pattern for reuse

adrian@share911.com

https://github.com/alanning/

A Pattern for FlowRouter Auth

By alanning55

A Pattern for FlowRouter Auth

  • 2,980