ログイン後にユーザーダッシュボードにリダイレクトしたいのですが、どうすればいいですか?現在、私は、登録ページとログインページを持っていますが、任意のファイルを必要とする、背中ログインと登録は、私はそれがダッシュボードに行きたいホームページにそれをログインした後、私はここでログイン後のダッシュボードへのリダイレクト[EMBER.JS]
UPDATE投稿:
をコントローラ/ application.js
import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service('session'),
actions: {
invalidateSession() {
this.get('session').invalidate();
}
}
});
コントローラ/ login.js
import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service('session'),
actions: {
authenticate() {
let { identification, password } =
this.getProperties('identification', 'password');
this.get('session').authenticate('authenticator:oauth2',
identification, password).catch((reason) => {
this.set('errorMessage', reason.error || reason);
});
}
}
});
ルートは/あなたがバックエンドに渡す/ログインを送るコードで
import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-
auth/mixins/application-route-mixin';
export default Ember.Route.extend(ApplicationRouteMixin, {
actions: {
invalidateSession() {
this.get('session').invalidate();
}
}
});
ルート/ login.js
import Ember from 'ember';
export default Ember.Route.extend({
});
を更新しました。占い:D – Techtique