So, I have an ember-rails application configured using the authentication API, and I can successfully (or not) authenticate using ember auth, and everything works. However, authentication is retained only during the current application session. If I reload the page or enter the URL, I must re-authenticate.
Are there any settings or settings necessary for the authorization token to be longer? I'm not necessarily talking about Remember Me functionality, as it makes the session a little more complicated.
My base code is:
Auth Object:
App.Auth = Em.Auth.create currentUser: null signInEndPoint: '/users/sign_in' signOutEndPoint: '/users/sign_out' tokenKey: 'auth_token' tokenIdKey: 'user_id'
Login:
App.AuthSignInView = Ember.View.extend templateName: 'auth/sign_in' email: null password: null submit: (event, view) -> event.preventDefault() event.stopPropagation() StripfighterEmber.Auth.signIn data: email: @get 'email' password: @get 'password'
Auth Template:
<form class="form-inline"> {{view Ember.TextField class="input-small" placeholder="Email" valueBinding="view.email"}} {{view Ember.TextField type="password" class="input-small" placeholder="Password" valueBinding="view.password"}} <button type="submit" class="btn btn-inverse btn-small">Sign in</button> </form>
source share