JWT Token strategy for frontend and backend

If we’re talking about not only working but also secure stateless authentication you will need to consider proper strategy with both access and refresh tokens. Access token is a token which provides an access to a protected resource. Expiration here might be installed approximately in ~1 hour (depends on your considerations). Refresh token is a … Read more

Ember.js multiple, named outlet usage

With the new Router you can do something like this: {{outlet “menu”}} {{outlet}} In your Route you can handle the content of the outlets: // application route Ember.Route.extend({ renderTemplate: function() { // Render default outlet this.render(); // render extra outlets this.render(“menu”, { outlet: “menu”, into: “application” // important when using at root level }); } … Read more

How to handle ‘no route matched’ in Ember.js and show 404 page?

App.Router.map(function() { //set up all of your known routes, and then… this.route(“fourOhFour”, { path: “*path”}); }); .. where you have your FourOhFourRoute defined to show the “no route found” message of your choosing. You will be able to access the originally requested path in the fourOhFour route as the path parameter. EDIT: just for clarity … Read more

Ember authentication best practices?

UPDATE: Like @DustMason says in his answer, check out the awesome embercasts for authentication best-practices. Client Side Authentication Part I Client Side Authentication Part II In order to completely separate the view (Ember app) from the server (Rails app) I want to use token authentication. I will likely use Devise on the Rails server. Makes … Read more

EmberJS actions – call one action from another when wrapped within `actions`

You can use the send(actionName, arguments) method. App.IndexController = Ember.ArrayController.extend({ actions: { actionFoo: function() { alert(‘foo’); this.send(‘actionBar’); }, actionBar: function() { alert(‘bar’); } } }); Here is a jsfiddle with this sample http://jsfiddle.net/marciojunior/pxz4y/

emberjs – how to mark active menu item using router infrastructure

Ember 1.11+: {{#link-to “dashboard” tagName=”li”}} <a href=”https://stackoverflow.com/questions/11628489/{{view.href}}”>Dashboard</a> {{/link-to}} Ember < 1.11 (bind-attr required): {{#link-to “dashboard” tagName=”li”}} <a {{bind-attr href=”https://stackoverflow.com/questions/11628489/view.href”}}>Dashboard</a> {{/link-to}}