Heroku Torii Provider
Usage
add torii-provider-heroku to your Ember app
npm install --save heroku/torii-provider-heroku
Include the mixin in your app/routes/application.js
file
import Ember from 'ember';
import HerokuAuthable from '@heroku/torii-provider-heroku/mixins/heroku-authable';
export default Ember.Route.extend(HerokuAuthable, {
});
redirect
By default, attempting to access a protect route as an unauthenticated user will trigger a redirect to id.heroku.com
{{link-to 'click to visit a protect routed and be redirected to Identity' 'some-protected-route'}}
// TODO figure out a way to popup/iframe here
pop-up
<button {{action 'loginToHeroku'}}>click to authenticate in a pop-up</button>
Testing
This repo includes a dummy app to demonstrate and test how it works. Start it up
by running yarn install
and yarn start
and then visiting localhost:4200