ember.js - Make Ember Route password protected -


I am trying to prompt the user with a model for which its password needs confirmation, The first route of transition (in this case my App.UserSettingsRoute ). I've got this to work normally (I'm opening the model and canceling the code in the hook before the model), and when the password is confirmed then the transition ), But I am facing the following problem:

When the user enters the direct path (by typing in the URL directly into the address bar or by refreshing the browser in the path), I can not open the modal (I get an error) because I did not enter any route yet - this is the first route which was entered in the application. My question: How can I find out that the current path I am entering is first? Alternatively, is there a better way to do this?

I have implemented this method with webcloud:

You can also use it:

  App.ApplicationRoute = Ember.Route.extend ({before model: function (transition, query parameter) {// Auth here .. .}});  

This route is always a hit, no matter what type of visitor your app is in.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -