Warning
This project has been merged into emberfire. If your using the latest version of emberfire then you don't need this addon to use the torii-provider for firebase.
As a result this addon is no longer maintained but remains for anyone using an older version of emberfire.
Torii-fire
This addon adds a torii-provider for authenticating firebase applications. It requires that you also have the firebase adapter, emberfire, and torii addons.
Here's an example-app showing how to use torii-fire in your application.
Installation using ember-cli
ember install torii-fire
Torii sessions
Torii has great session management if you require it. What follows is a quick guide to getting started using torii sessions with torii-fire.
First, install torii, emberfire and torii-fire:
ember install:addon toriiember install:addon emberfireember install:addon torii-fire
You must tell torii that you'd like session management enabled and setup your emberfire url:
// config/environment.js/* ... */ firebase: 'https://YOUR-FIREBASE-NAME.firebaseio.com/' torii: // a 'session' property will be injected on routes and controllers sessionServiceName: 'session' /* ... */
Next let's setup our application route, run ember g route application
and make
the following changes to the template and route:
{{! app/templates/application.hbs }}<h2 id="title">Welcome to torii-fire!</h2> {{#if session.isAuthenticated}} {{outlet}}{{else}} <button {{action "signIn" "github"}}>Sign in with github</button> <button {{action "signIn" "facebook"}}>Sign in with facebook</button> <button {{action "signIn" "twitter"}}>Sign in with twitter</button> <button {{action "signIn" "google"}}>Sign in with google</button>{{/if}}
// app/routes/application.js; Route;
Now that we have our route setup calling open
, fetch
and close
we'll need
to create our torii adapter to define those behaviours:
// app/torii-adapters/application.js ; Object;
The above code assumes user and message models are defined.
Running
ember server
- Visit your app at http://localhost:4200.
Running Tests
ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.