Ember.js 获取在用户配置文件创建期间创建的JWT令牌:Ember js

Ember.js 获取在用户配置文件创建期间创建的JWT令牌:Ember js,ember.js,Ember.js,我正在使用ember simple auth和jwt对用户配置文件进行身份验证,这是用于注册的代码,注册后我不想在控制台中打印创建的令牌值(在响应中) import Controller from '@ember/controller'; export default Controller.extend({ actions: { signup: function(){ var credentials = this.getProperties('n

我正在使用ember simple auth和jwt对用户配置文件进行身份验证,这是用于注册的代码,注册后我不想在控制台中打印创建的令牌值(在响应中)

import Controller from '@ember/controller';

export default Controller.extend({
    actions: {
        signup: function(){
            var credentials = this.getProperties('name','identification','password');
            let list = this.store.createRecord('user', {
                name: credentials.name,
                email: credentials.identification,
                password: credentials.password
            });
            list.save();

        // I want to print the token value in console here

            this.setProperties({
                'name': '',
                'identification': '',
                'password': ''
            });


        }
    }
});

@Sreenath,既然你说jwt存储在服务中, 这是您将console.log记录它的方式



你知道令牌存储在哪里吗?它在服务中吗?它在本地存储吗?它在别处吗?你看过jwt插件代码了吗?它存储在服务中@NullVoxPopuli如果这是你问题的答案,请单击投票箭头下的复选标记,因为它会给我点数,鼓励我继续帮助人们解决堆栈溢出问题:)是的,当然@NullVoxPopuli
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';

export default Controller.extend({
    nameOfService: service(),

    actions: {
        signup: function(){
            // ...

            // I want to print the token value in console here
            console.log(this.nameOfService.nameofPropertyThatJWTIsOn);

            // ...


        }
    }
});