I am using ember-simple-auth and jwt to authenticate a user profile, this is a code for signup and after signing up I wan't to print the token value created(which is in the response) in the console
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': ''
});
}
}
});
Aucun commentaire:
Enregistrer un commentaire