Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Wolfgang Knopki
Spacedeck-open-SAML
Commits
b93cc203
Commit
b93cc203
authored
May 11, 2020
by
mntmn
Committed by
mntmn
May 11, 2020
Browse files
users: add api_token attribute, make editable in profile/account
parent
46769691
Changes
4
Hide whitespace changes
Inline
Side-by-side
models/db.js
View file @
b93cc203
...
...
@@ -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
,
...
...
models/migrations/02-users-add-api-token.js
0 → 100644
View file @
b93cc203
'
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
'
)
])
}
}
public/javascripts/spacedeck_users.js
View file @
b93cc203
...
...
@@ -17,7 +17,6 @@ SpacedeckUsers = {
loading_user
:
false
,
password_reset_confirm_error
:
""
,
password_reset_error
:
""
,
},
methods
:{
load_user
:
function
(
on_success
,
on_error
)
{
...
...
views/partials/account.html
View file @
b93cc203
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment