Commit b93cc203 authored by mntmn's avatar mntmn Committed by mntmn
Browse files

users: add api_token attribute, make editable in profile/account

parent 46769691
......@@ -42,6 +42,7 @@ module.exports = {
avatar_thumb_uri: Sequelize.STRING,
confirmation_token: Sequelize.STRING,
password_reset_token: Sequelize.STRING,
api_token: Sequelize.STRING,
home_folder_id: Sequelize.STRING,
prefs_language: Sequelize.STRING,
prefs_email_notifications: Sequelize.STRING,
......
'use strict';
module.exports = {
up: function(migration, DataTypes) {
return Promise.all([
migration.addColumn('users', 'api_token',
{
type: DataTypes.STRING
}
)
])
},
down: function(migration, DataTypes) {
return Promise.all([
migration.removeColumn('users', 'api_token')
])
}
}
......@@ -17,7 +17,6 @@ SpacedeckUsers = {
loading_user: false,
password_reset_confirm_error: "",
password_reset_error: "",
},
methods:{
load_user: function(on_success, on_error) {
......
......@@ -55,6 +55,15 @@
</div>
<div>
<div class="form-group">
<label class="label">API Token</label>
<input
type="text"
id="api-token"
class="input input-white no-b"
v-model="user.api_token"
placeholder="secret key">
</div>
<div class="form-group">
<label class="label" >[[__("profile_name")]]</label>
......@@ -67,18 +76,17 @@
<div class="form-group">
<label class="label">[[__("profile_email")]]</label>
<input
type="email"
id="new-email"
v-bind:class="{disabled: user.account_type=='google'}"
v-bind:disabled="user.account_type=='google'"
class="input input-white no-b"
type="email"
v-model="user.email"
v-on:change="user.email_changed=true"
placeholder="mail@example.com">
</div>
<button class="btn btn-md btn-dark" v-on:click=" save_user()" style="margin-top:20px">Save</button>
<div class="form-group">
<button class="btn btn-md btn-dark" v-on:click="save_user()">Save</button>
</div>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment