Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85951175
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
38 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/settings_modal/settings_modal.scss b/src/components/settings_modal/settings_modal.scss
index 9d36b9358a..f366bf19f0 100644
--- a/src/components/settings_modal/settings_modal.scss
+++ b/src/components/settings_modal/settings_modal.scss
@@ -1,322 +1,325 @@
.settings-modal {
overflow: hidden;
h2 {
font-size: 1.3rem;
font-weight: 500;
- margin-top: 1em;
+ margin-top: 2em;
margin-bottom: 1em;
- margin-right: 1em;
+ margin-left: -1em;
+ width: 100%;
+ padding-right: 1em;
+ padding-left: 1em;
}
h3 {
box-sizing: border-box;
font-size: 1.2rem;
font-weight: 500;
+ border-bottom: 4px double var(--border);
margin-top: 1em;
margin-bottom: 0.5em;
- margin-left: -1.5em;
- border-bottom: 2px solid var(--border);
+ margin-left: -0.5em;
padding-bottom: 0.25em;
padding-left: 0.5em;
}
h4 {
font-size: 1.1rem;
margin-top: 1em;
- margin-right: 1em;
margin-bottom: 0.5em;
- margin-left: 1em;
+ border-bottom: 2px solid var(--border);
}
h5 {
font-size: 1rem;
- margin-left: 1em;
margin-bottom: 0.25em;
margin-top: 0.75em;
+ margin-left: 0;
+ margin-right: 0;
}
.toolbar {
display: flex;
flex-wrap: wrap;
gap: 0.5em;
align-items: end;
.header-buttons {
display: flex;
flex: 1 0 auto;
justify-content: end;
align-items: end;
&:not(.btn-group) {
gap: 0.5em;
}
.header-text {
flex: 1 0 auto;
}
}
.button-default {
flex: 0 0 auto;
padding: 0.5em;
font-size: 1rem;
}
}
p {
line-height: 1.5;
margin-left: 2em;
}
.sidenote {
margin-left: 5em;
padding: 0.25em 1em;
margin-top: 0.25em;
}
.setting-description {
margin-top: 0.2em;
margin-bottom: 0;
margin-left: 0;
font-size: 80%;
}
.setting-item {
display: grid;
border: 0;
grid-template-areas:
"label control"
"label desc"
". draft";
grid-template-columns: 4fr 5fr;
column-gap: 0.5em;
align-items: baseline;
padding: 0.5em 0;
line-height: 1.5em;
.setting-label {
float: left;
grid-area: label;
text-align: right;
}
.ModifiedIndicator,
.LocalSettingIndicator {
grid-area: indicator;
}
.setting-control {
display: flex;
grid-area: control;
&.textarea {
align-self: baseline;
overflow: auto;
}
&.checkbox {
display: grid;
grid-template-columns: subgrid;
grid-template-rows: subgrid;
.label {
grid-area: label;
text-align: right;
}
.checkbox-indicator {
grid-area: control;
align-self: end;
}
.-mobile & {
.label {
text-align: left;
}
}
}
}
.setting-control.setting-label {
grid-column: 1 / 3;
text-align: left;
}
.setting-description {
grid-area: desc;
}
.DraftButtons {
grid-area: draft;
}
}
.vertical-tab-switcher {
height: 100%;
}
.setting-list,
.option-list {
list-style-type: none;
padding-left: 0;
margin: 0;
&.suboptions {
margin-left: 2em;
border-top: 1px dotted var(--border);
border-bottom: 1px dotted var(--border);
}
.btn:not(.dropdown-button) {
padding: 0 2em;
}
.btn-group {
.button-default {
flex: 0 1 auto;
}
}
&.two-column {
display: grid;
grid-template-columns: 1fr 1fr;
margin-left: 2em;
border-bottom: 1px solid var(--border);
padding-bottom: 0.5em;
margin-bottom: 1em;
.setting-item {
grid-template-columns: 3fr 1fr;
}
> li {
margin: 0;
break-inside: avoid;
}
}
}
.settings-modal-panel {
overflow: hidden;
transition: transform;
transition-timing-function: ease-in-out;
transition-duration: 300ms;
width: 70em;
max-width: 90vw;
height: 90vh;
@media all and (width <= 800px) {
max-width: 100vw;
height: 100%;
}
>.panel-body {
height: 100%;
overflow-y: hidden;
.btn {
min-height: 2em;
}
}
}
.settings-footer {
display: flex;
flex-wrap: wrap;
line-height: 2;
>* {
margin-right: 0.5em;
}
.extra-content {
display: flex;
flex-grow: 1;
}
}
&.-mobile {
.tabs {
.menu-item {
font-size: 1.2em;
padding-top: 0.75em;
padding-bottom: 0.75em;
}
}
li {
.sidenote {
margin-left: 1em;
}
}
/* stylelint-disable no-descending-specificity */
.setting-item {
grid-template-columns: 1fr min-content;
column-gap: 0.5em;
padding: 1em;
align-items: center;
.setting-label {
text-align: left;
}
.checkbox {
.label {
text-align: left;
order: 2;
}
.checkbox-indicator {
order: 1;
}
}
}
ul {
padding: 0;
li:not(:first-child) {
.setting-item {
border-top: 1px solid var(--border);
}
}
}
.setting-list:not(.suboptions),
.option-list {
&.two-column {
grid-template-columns: 1fr;
}
}
.UnitSetting {
padding-right: 0.5em;
}
}
&.minimize {
.settings-modal-panel {
/* Explanation:
* Modal is positioned vertically centered.
* 100vh - 100% = Distance between modal's top+bottom boundaries and screen
* (100vh - 100%) / 2 = Distance between bottom (or top) boundary and screen
* + 100% - we move modal completely off-screen, it's top boundary touches
* bottom of the screen
* - 50px - leaving tiny amount of space so that titlebar + tiny amount of modal is visible
*/
transform: translateY(calc(((100vh - 100%) / 2 + 100%) - 50px));
@media all and (width <= 800px) {
/* For mobile, the modal takes 100% of the available screen.
This ensures the minimized modal is always 50px above the browser bottom
bar regardless of whether or not it is visible.
*/
transform: translateY(calc(100% - 50px));
}
}
}
}
diff --git a/src/components/settings_modal/tabs/security_tab/mfa.js b/src/components/settings_modal/tabs/security_tab/mfa.js
index 1277b42ece..7eb32b122f 100644
--- a/src/components/settings_modal/tabs/security_tab/mfa.js
+++ b/src/components/settings_modal/tabs/security_tab/mfa.js
@@ -1,178 +1,178 @@
import VueQrcode from '@chenfengyuan/vue-qrcode'
import Confirm from './confirm.vue'
import RecoveryCodes from './mfa_backup_codes.vue'
import TOTP from './mfa_totp.vue'
import { useOAuthStore } from 'src/stores/oauth.js'
import {
generateMfaBackupCodes,
mfaConfirmOTP,
mfaSetupOTP,
settingsMFA,
} from 'src/api/user.js'
const Mfa = {
data: () => ({
settings: {
// current settings of MFA
available: false,
enabled: false,
totp: false,
},
setupState: {
// setup mfa
state: '', // state of setup. '' -> 'getBackupCodes' -> 'setupOTP' -> 'complete'
setupOTPState: '', // state of setup otp. '' -> 'prepare' -> 'confirm' -> 'complete'
},
backupCodes: {
getNewCodes: false,
inProgress: false, // progress of fetch codes
codes: [],
},
otpSettings: {
// pre-setup setting of OTP. secret key, qrcode url.
provisioning_uri: '',
key: '',
},
currentPassword: null,
otpConfirmToken: null,
error: null,
readyInit: false,
}),
components: {
- 'recovery-codes': RecoveryCodes,
- 'totp-item': TOTP,
+ RecoveryCodes,
+ 'TOTPItem': TOTP,
qrcode: VueQrcode,
confirm: Confirm,
},
computed: {
canSetupOTP() {
return (
((this.setupInProgress && this.backupCodesPrepared) ||
this.settings.enabled) &&
!this.settings.totp &&
!this.setupOTPInProgress
)
},
setupInProgress() {
return (
this.setupState.state !== '' && this.setupState.state !== 'complete'
)
},
setupOTPInProgress() {
return this.setupState.state === 'setupOTP' && !this.completedOTP
},
prepareOTP() {
return this.setupState.setupOTPState === 'prepare'
},
confirmOTP() {
return this.setupState.setupOTPState === 'confirm'
},
completedOTP() {
return this.setupState.setupOTPState === 'completed'
},
backupCodesPrepared() {
return !this.backupCodes.inProgress && this.backupCodes.codes.length > 0
},
confirmNewBackupCodes() {
return this.backupCodes.getNewCodes
},
},
methods: {
activateOTP() {
if (!this.settings.enabled) {
this.setupState.state = 'getBackupcodes'
this.fetchBackupCodes()
}
},
fetchBackupCodes() {
this.backupCodes.inProgress = true
this.backupCodes.codes = []
return generateMfaBackupCodes({
credentials: useOAuthStore().token,
}).then(({ data: res }) => {
this.backupCodes.codes = res.codes
this.backupCodes.inProgress = false
})
},
getBackupCodes() {
// get a new backup codes
this.backupCodes.getNewCodes = true
},
confirmBackupCodes() {
// confirm getting new backup codes
this.fetchBackupCodes().then(() => {
this.backupCodes.getNewCodes = false
})
},
cancelBackupCodes() {
// cancel confirm form of new backup codes
this.backupCodes.getNewCodes = false
},
// Setup OTP
setupOTP() {
// prepare setup OTP
this.setupState.state = 'setupOTP'
this.setupState.setupOTPState = 'prepare'
mfaSetupOTP({
credentials: useOAuthStore().token,
}).then(({ data: res }) => {
this.otpSettings = res
this.setupState.setupOTPState = 'confirm'
})
},
doConfirmOTP() {
// handler confirm enable OTP
this.error = null
mfaConfirmOTP({
token: this.otpConfirmToken,
password: this.currentPassword,
credentials: useOAuthStore().token,
})
.then(() => {
this.completeSetup()
})
.catch((error) => {
this.error = error
})
},
completeSetup() {
this.setupState.setupOTPState = 'complete'
this.setupState.state = 'complete'
this.currentPassword = null
this.error = null
this.fetchSettings()
},
cancelSetup() {
// cancel setup
this.setupState.setupOTPState = ''
this.setupState.state = ''
this.currentPassword = null
this.error = null
},
// end Setup OTP
// fetch settings from server
async fetchSettings() {
const { data: result } = await settingsMFA({
credentials: useOAuthStore().token,
})
if (result.error) return
this.settings = result.settings
this.settings.available = true
return result
},
},
mounted() {
this.fetchSettings().then(() => {
this.readyInit = true
})
},
}
export default Mfa
diff --git a/src/components/settings_modal/tabs/security_tab/mfa.vue b/src/components/settings_modal/tabs/security_tab/mfa.vue
index 2fea14a29e..2fe801f7cd 100644
--- a/src/components/settings_modal/tabs/security_tab/mfa.vue
+++ b/src/components/settings_modal/tabs/security_tab/mfa.vue
@@ -1,196 +1,183 @@
<template>
<div
v-if="readyInit && settings.available"
class="setting-section mfa-settings"
>
- <div class="mfa-heading">
- <h2>{{ $t('settings.mfa.title') }}</h2>
- </div>
-
- <div>
- <div
- v-if="!setupInProgress"
- class="setting-section"
- >
- <!-- Enabled methods -->
- <h3>{{ $t('settings.mfa.authentication_methods') }}</h3>
- <totp-item
- :settings="settings"
- @deactivate="fetchSettings"
- @activate="activateOTP"
- />
- <br>
-
- <div v-if="settings.enabled">
+ <h3>{{ $t('settings.mfa.title') }}</h3>
+ <div
+ v-if="!setupInProgress"
+ class="setting-section"
+ >
+ <!-- Enabled methods -->
+ <h4>{{ $t('settings.mfa.authentication_methods') }}</h4>
+ <TOTPItem
+ :settings="settings"
+ @deactivate="fetchSettings"
+ @activate="activateOTP"
+ />
+ <br>
+
+ <div v-if="settings.enabled">
+ <template v-if="!confirmNewBackupCodes">
<!-- backup codes block-->
- <recovery-codes
- v-if="!confirmNewBackupCodes"
- :backup-codes="backupCodes"
- />
+ <RecoveryCodes :backup-codes="backupCodes" />
<button
- v-if="!confirmNewBackupCodes"
class="btn button-default"
@click="getBackupCodes"
>
{{ $t('settings.mfa.generate_new_recovery_codes') }}
</button>
- <div v-if="confirmNewBackupCodes">
- <confirm
- :disabled="backupCodes.inProgress"
- @confirm="confirmBackupCodes"
- @cancel="cancelBackupCodes"
- >
- <p class="warning">
- {{ $t('settings.mfa.warning_of_generate_new_codes') }}
- </p>
- </confirm>
- </div>
+ </template>
+ <div v-else>
+ <confirm
+ :disabled="backupCodes.inProgress"
+ @confirm="confirmBackupCodes"
+ @cancel="cancelBackupCodes"
+ >
+ <p class="warning">
+ {{ $t('settings.mfa.warning_of_generate_new_codes') }}
+ </p>
+ </confirm>
</div>
</div>
+ </div>
+ <div v-else>
+ <!-- setup block-->
- <div v-if="setupInProgress">
- <!-- setup block-->
-
- <h3>{{ $t('settings.mfa.setup_otp') }}</h3>
-
- <recovery-codes
- v-if="!setupOTPInProgress"
- :backup-codes="backupCodes"
- />
-
- <button
- v-if="canSetupOTP"
- class="btn button-default"
- @click="cancelSetup"
- >
- {{ $t('general.cancel') }}
- </button>
- {{ ' ' }}
- <button
- v-if="canSetupOTP"
- class="btn button-default"
- @click="setupOTP"
- >
- {{ $t('settings.mfa.setup_otp') }}
- </button>
-
- <template v-if="setupOTPInProgress">
- <i v-if="prepareOTP">{{ $t('settings.mfa.wait_pre_setup_otp') }}</i>
-
- <div v-if="confirmOTP">
- <div class="setup-otp">
- <div class="qr-code">
- <h4>{{ $t('settings.mfa.scan.title') }}</h4>
- <p>{{ $t('settings.mfa.scan.desc') }}</p>
- <qrcode
- :value="otpSettings.provisioning_uri"
- :options="{ width: 200 }"
- />
- <p>
- {{ $t('settings.mfa.scan.secret_code') }}:
- {{ otpSettings.key }}
- </p>
- </div>
+ <h4>{{ $t('settings.mfa.setup_otp') }}</h4>
- <div class="verify">
- <h4>{{ $t('general.verify') }}</h4>
- <p>
- {{ $t('settings.mfa.verify.desc') }}
- </p>
- <input
- v-model="otpConfirmToken"
- :title="$t('settings.mfa.verify.label')"
- type="text"
- class="input"
- >
+ <recovery-codes
+ v-if="!setupOTPInProgress"
+ :backup-codes="backupCodes"
+ />
+
+ <button
+ v-if="canSetupOTP"
+ class="btn button-default"
+ @click="cancelSetup"
+ >
+ {{ $t('general.cancel') }}
+ </button>
+ {{ ' ' }}
+ <button
+ v-if="canSetupOTP"
+ class="btn button-default"
+ @click="setupOTP"
+ >
+ {{ $t('settings.mfa.setup_otp') }}
+ </button>
+
+ <template v-if="setupOTPInProgress">
+ <i v-if="prepareOTP">{{ $t('settings.mfa.wait_pre_setup_otp') }}</i>
+
+ <div v-if="confirmOTP">
+ <div class="setup-otp">
+ <div class="qr-code">
+ <h5>{{ $t('settings.mfa.scan.title') }}</h5>
+ <p>{{ $t('settings.mfa.scan.desc') }}</p>
+ <qrcode
+ :value="otpSettings.provisioning_uri"
+ :options="{ width: 200 }"
+ />
+ <p>
+ {{ $t('settings.mfa.scan.secret_code') }}:
+ {{ otpSettings.key }}
+ </p>
+ </div>
- <p>{{ $t('settings.enter_current_password_to_confirm') }}:</p>
- <input
- v-model="currentPassword"
- type="password"
- :title="$t('settings.current_password')"
- class="input"
+ <div class="verify">
+ <h5>{{ $t('general.verify') }}</h5>
+ <p>
+ {{ $t('settings.mfa.verify.desc') }}
+ </p>
+ <input
+ v-model="otpConfirmToken"
+ :title="$t('settings.mfa.verify.label')"
+ type="text"
+ class="input"
+ >
+
+ <p>{{ $t('settings.enter_current_password_to_confirm') }}:</p>
+ <input
+ v-model="currentPassword"
+ type="password"
+ :title="$t('settings.current_password')"
+ class="input"
+ >
+ <div class="confirm-otp-actions">
+ <button
+ class="btn button-default"
+ @click="doConfirmOTP"
>
- <div class="confirm-otp-actions">
- <button
- class="btn button-default"
- @click="doConfirmOTP"
- >
- {{ $t('settings.mfa.confirm_and_enable') }}
- </button>
- <button
- class="btn button-default"
- @click="cancelSetup"
- >
- {{ $t('general.cancel') }}
- </button>
- </div>
- <div
- v-if="error"
- class="alert error"
+ {{ $t('settings.mfa.confirm_and_enable') }}
+ </button>
+ <button
+ class="btn button-default"
+ @click="cancelSetup"
>
- {{ error }}
- </div>
+ {{ $t('general.cancel') }}
+ </button>
+ </div>
+ <div
+ v-if="error"
+ class="alert error"
+ >
+ {{ error }}
</div>
</div>
</div>
- </template>
- </div>
+ </div>
+ </template>
</div>
</div>
</template>
<script src="./mfa.js"></script>
<style lang="scss">
.mfa-settings {
- .mfa-heading,
.method-item {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: baseline;
}
- h4 {
- margin-left: 0;
- }
-
p {
margin: 0 0 0.5em;
}
input {
margin-bottom: 1em
}
.warning {
color: var(--cOrange);
}
.setup-otp {
display: flex;
justify-content: center;
flex-wrap: wrap;
.qr-code {
flex: 1;
padding-right: 0.7em;
}
.verify {
flex: 1;
}
.error {
margin: 0.3em 0 0;
}
.confirm-otp-actions {
button {
width: 15em;
margin-top: 5px;
}
}
}
}
</style>
diff --git a/src/components/settings_modal/tabs/security_tab/mfa_backup_codes.vue b/src/components/settings_modal/tabs/security_tab/mfa_backup_codes.vue
index 32a8a759cb..653a6500b9 100644
--- a/src/components/settings_modal/tabs/security_tab/mfa_backup_codes.vue
+++ b/src/components/settings_modal/tabs/security_tab/mfa_backup_codes.vue
@@ -1,33 +1,33 @@
<template>
<div class="mfa-backup-codes">
- <h4 v-if="displayTitle">
+ <h5 v-if="displayTitle">
{{ $t('settings.mfa.recovery_codes') }}
- </h4>
+ </h5>
<i v-if="inProgress">{{ $t('settings.mfa.waiting_a_recovery_codes') }}</i>
<template v-if="ready">
<p class="alert warning">
{{ $t('settings.mfa.recovery_codes_warning') }}
</p>
<ul class="backup-codes">
<li
v-for="code in backupCodes.codes"
:key="code"
>
{{ code }}
</li>
</ul>
</template>
</div>
</template>
<script src="./mfa_backup_codes.js"></script>
<style lang="scss">
.mfa-backup-codes {
.warning {
color: var(--cOrange);
}
.backup-codes {
font-family: var(--monoFont);
}
}
</style>
diff --git a/src/components/settings_modal/tabs/security_tab/security_tab.js b/src/components/settings_modal/tabs/security_tab/security_tab.js
index c26df9b400..96702e7f2a 100644
--- a/src/components/settings_modal/tabs/security_tab/security_tab.js
+++ b/src/components/settings_modal/tabs/security_tab/security_tab.js
@@ -1,169 +1,169 @@
import Checkbox from 'src/components/checkbox/checkbox.vue'
import ProgressButton from 'src/components/progress_button/progress_button.vue'
-import Mfa from './mfa.vue'
+import MFA from './mfa.vue'
import Tokens from './tokens.vue'
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
import { useOAuthStore } from 'src/stores/oauth.js'
import { useUsersStore } from 'src/stores/users.js'
import {
addAlias,
changeEmail,
changePassword,
deleteAccount,
deleteAlias,
listAliases,
moveAccount,
} from 'src/api/user.js'
const SecurityTab = {
data() {
return {
newEmail: '',
changeEmailError: false,
changeEmailPassword: '',
changedEmail: false,
deletingAccount: false,
deleteAccountConfirmPasswordInput: '',
deleteAccountError: false,
changePasswordInputs: ['', '', ''],
changedPassword: false,
changePasswordError: false,
moveAccountTarget: '',
moveAccountPassword: '',
movedAccount: false,
moveAccountError: false,
aliases: [],
listAliasesError: false,
addAliasTarget: '',
addedAlias: false,
addAliasError: false,
}
},
created() {
this.fetchAliases()
},
components: {
ProgressButton,
- Mfa,
+ MFA,
Checkbox,
Tokens,
},
computed: {
user() {
return useUsersStore().currentUser
},
pleromaExtensionsAvailable() {
return useInstanceCapabilitiesStore().pleromaExtensionsAvailable
},
},
methods: {
confirmDelete() {
this.deletingAccount = true
},
deleteAccount() {
deleteAccount({
credentials: useOAuthStore().token,
password: this.deleteAccountConfirmPasswordInput,
}).then(({ data: res }) => {
if (res.status === 'success') {
useUsersStore().logout()
this.$router.push({ name: 'root' })
} else {
this.deleteAccountError = res.error
}
})
},
changePassword() {
const params = {
password: this.changePasswordInputs[0],
newPassword: this.changePasswordInputs[1],
newPasswordConfirmation: this.changePasswordInputs[2],
credentials: useOAuthStore().token,
}
changePassword(params).then(({ data: res }) => {
if (res.status === 'success') {
this.changedPassword = true
this.changePasswordError = false
this.logout()
} else {
this.changedPassword = false
this.changePasswordError = res.error
}
})
},
changeEmail() {
const params = {
email: this.newEmail,
password: this.changeEmailPassword,
credentials: useOAuthStore().token,
}
changeEmail(params).then(({ data: res }) => {
if (res.status === 'success') {
this.changedEmail = true
this.changeEmailError = false
} else {
this.changedEmail = false
this.changeEmailError = res.error
}
})
},
moveAccount() {
const params = {
targetAccount: this.moveAccountTarget,
password: this.moveAccountPassword,
credentials: useOAuthStore().token,
}
moveAccount(params).then(({ data: res }) => {
if (res.status === 'success') {
this.movedAccount = true
this.moveAccountError = false
} else {
this.movedAccount = false
this.moveAccountError = res.error
}
})
},
removeAlias(alias) {
deleteAlias({
alias,
credentials: useOAuthStore().token,
}).then(() => this.fetchAliases())
},
addAlias() {
addAlias({
alias: this.addAliasTarget,
credentials: useOAuthStore().token,
})
.then(() => {
this.addedAlias = true
this.addAliasError = false
this.addAliasTarget = ''
})
.catch((error) => {
this.addedAlias = false
this.addAliasError = error
})
.then(() => this.fetchAliases())
},
fetchAliases() {
listAliases({
credentials: useOAuthStore().token,
})
.then(({ data: res }) => {
this.aliases = res.aliases
this.listAliasesError = false
})
.catch((error) => {
this.listAliasesError = error.error
})
},
logout() {
useUsersStore().logout()
this.$router.replace('/')
},
},
}
export default SecurityTab
diff --git a/src/components/settings_modal/tabs/security_tab/security_tab.vue b/src/components/settings_modal/tabs/security_tab/security_tab.vue
index ed3feb3dda..2290550492 100644
--- a/src/components/settings_modal/tabs/security_tab/security_tab.vue
+++ b/src/components/settings_modal/tabs/security_tab/security_tab.vue
@@ -1,314 +1,315 @@
<template>
<div :label="$t('settings.security_tab')">
<div class="setting-section">
<h3>{{ $t('settings.change_email') }}</h3>
<ul class="setting-list">
<li>
<span class="setting-item">
<label
class="setting-label"
for="new-email"
>
{{ $t('settings.new_email') }}
</label>
<input
id="new-email"
v-model="newEmail"
type="email"
autocomplete="email"
class="input"
>
</span>
<span class="setting-item">
<label
class="setting-label"
for="new-email-password"
>
{{ $t('settings.current_password') }}
</label>
<input
id="new-email-password"
v-model="changeEmailPassword"
type="password"
autocomplete="current-password"
class="input setting-control"
>
</span>
<span class="setting-item">
<span class="setting-control">
<button
class="btn button-default"
@click="changeEmail"
>
{{ $t('settings.save') }}
</button>
</span>
</span>
<center>
<p v-if="changedEmail">
{{ $t('settings.changed_email') }}
</p>
<template v-if="changeEmailError !== false">
<p>{{ $t('settings.change_email_error') }}</p>
<p>{{ changeEmailError }}</p>
</template>
</center>
</li>
</ul>
</div>
<div class="setting-section">
<h3>{{ $t('settings.change_password') }}</h3>
<ul class="setting-list">
<li>
<span class="setting-item">
<label
class="setting-label"
for="new-password-current"
>
{{ $t('settings.current_password') }}
</label>
<input
id="new-password-current"
v-model="changePasswordInputs[0]"
type="password"
class="input setting-control"
>
</span>
<span class="setting-item">
<label
class="setting-label"
for="new-password-new"
>
{{ $t('settings.new_password') }}
</label>
<input
id="new-password-new"
v-model="changePasswordInputs[1]"
type="password"
class="input setting-control"
>
</span>
<span class="setting-item">
<label
class="setting-label"
for="new-password-again"
>
{{ $t('settings.confirm_new_password') }}
</label>
<input
id="new-password-again"
v-model="changePasswordInputs[2]"
type="password"
class="input setting-control"
>
</span>
<span class="setting-item">
<span class="setting-control">
<button
class="btn button-default"
@click="changePassword"
>
{{ $t('settings.save') }}
</button>
</span>
</span>
<center>
<p v-if="changedPassword">
{{ $t('settings.changed_password') }}
</p>
<p v-else-if="changePasswordError !== false">
{{ $t('settings.change_password_error') }}
</p>
<p v-if="changePasswordError">
{{ changePasswordError }}
</p>
</center>
</li>
</ul>
</div>
<div class="setting-section">
<h3>{{ $t('settings.account_alias') }}</h3>
<ul class="setting-list">
<li>
<table v-if="aliases.length > 0">
<thead>
<tr>
<th>{{ $t('settings.account_alias_table_head') }}</th>
<th />
</tr>
</thead>
<tbody>
<tr
v-for="alias in aliases"
:key="alias"
>
<td>{{ alias }}</td>
<td class="actions">
<button
class="btn button-default"
@click="removeAlias(alias)"
>
{{ $t('settings.remove_alias') }}
</button>
</td>
</tr>
</tbody>
</table>
<div
v-if="listAliasesError"
class="alert error"
>
{{ $t('settings.list_aliases_error', { error }) }}
<FAIcon
class="fa-scale-110 fa-old-padding"
icon="times"
:title="$t('settings.hide_list_aliases_error_action')"
@click="listAliasesError = false"
/>
</div>
</li>
<li>
<div class="setting-item">
<i18n-t
scope="global"
keypath="settings.new_alias_target"
for="add-alias-target"
tag="label"
class="setting-label"
>
<template #example>
<code>foo@example.org</code>
</template>
</i18n-t>
<input
id="add-alias-target"
v-model="addAliasTarget"
class="input setting-control"
>
</div>
<div class="setting-item">
<span class="setting-control">
<button
class="btn button-default"
@click="addAlias"
>
{{ $t('settings.save') }}
</button>
</span>
</div>
<center>
<p v-if="addedAlias">
{{ $t('settings.added_alias') }}
</p>
<template v-if="addAliasError !== false">
<p>{{ $t('settings.add_alias_error', { error: addAliasError }) }}</p>
</template>
</center>
</li>
</ul>
</div>
<Tokens />
- <mfa />
+
+ <MFA />
<div class="setting-section">
<h3>{{ $t('settings.move_account') }}</h3>
<p>{{ $t('settings.move_account_notes') }}</p>
<ul class="setting-list">
<li>
<div class="setting-item">
<i18n-t
keypath="settings.move_account_target"
tag="label"
scope="global"
class="setting-label"
for="move-account-target"
>
<template #example>
<code>foo@example.org</code>
</template>
</i18n-t>
<input
id="move-account-target"
v-model="moveAccountTarget"
class="input setting-control"
>
</div>
<div class="setting-item">
<label
class="setting-label"
for="move-account-password"
>
{{ $t('settings.current_password') }}
</label>
<input
id="move-account-password"
v-model="moveAccountPassword"
type="password"
autocomplete="current-password"
class="input"
>
</div>
<div class="setting-item">
<div class="setting-control">
<button
class="btn button-default"
@click="moveAccount"
>
{{ $t('settings.save') }}
</button>
</div>
</div>
<center>
<p v-if="movedAccount">
{{ $t('settings.moved_account') }}
</p>
<template v-if="moveAccountError !== false">
<p>{{ $t('settings.move_account_error', { error: moveAccountError }) }}</p>
</template>
</center>
</li>
</ul>
</div>
<div class="setting-section">
<h3>{{ $t('settings.delete_account') }}</h3>
<p v-if="!deletingAccount">
{{ $t('settings.delete_account_description') }}
</p>
<div v-if="deletingAccount">
<p>{{ $t('settings.delete_account_instructions') }}</p>
<p>{{ $t('login.password') }}</p>
<input
v-model="deleteAccountConfirmPasswordInput"
type="password"
class="input"
>
<button
class="btn button-default"
@click="deleteAccount"
>
{{ $t('settings.delete_account') }}
</button>
</div>
<p v-if="deleteAccountError !== false">
{{ $t('settings.delete_account_error') }}
</p>
<p v-if="deleteAccountError">
{{ deleteAccountError }}
</p>
<button
v-if="!deletingAccount"
class="btn button-default -danger"
@click="confirmDelete"
>
{{ $t('settings.delete_account') }}
</button>
</div>
</div>
</template>
<script src="./security_tab.js"></script>
<!-- <style lang="scss" src="./profile.scss"></style> -->
diff --git a/src/components/settings_modal/tabs/security_tab/tokens.scss b/src/components/settings_modal/tabs/security_tab/tokens.scss
index d145770be6..40cc14e188 100644
--- a/src/components/settings_modal/tabs/security_tab/tokens.scss
+++ b/src/components/settings_modal/tabs/security_tab/tokens.scss
@@ -1,116 +1,120 @@
.Tokens {
.alerts {
display: block;
margin: 1em;
text-align: center;
.alert {
position: relative;
display: inline-block;
padding: 0.25em 3em;
.dismiss {
position: absolute;
top: 0;
right: 0;
width: 2em;
height: 2em;
}
pre {
margin: 0.25em;
}
}
}
.table-wrapper {
position: relative;
table {
display: grid;
grid-template-columns: auto 1fr auto auto auto;
grid-template-rows: auto 1fr;
thead,
tbody {
display: grid;
grid-column: 1 / -1;
grid-template-columns: subgrid;
gap: 0.5em;
}
thead {
grid-row: 1;
border-bottom: 1px solid var(--border);
padding-bottom: 0.25em;
}
tbody {
grid-row: 2;
max-height: 20em;
padding-top: 0.25em;
overflow: clip auto;
}
tr {
display: grid;
grid-column: 1 / -1;
grid-template-columns: subgrid;
place-items: center start;
&.-us {
font-style: italic;
}
}
td {
+ display: block;
min-width: 0;
+ max-width: 100%;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
}
}
.overlay {
position: absolute;
inset: 0;
display: grid;
place-items: center;
place-content: center;
text-align: center;
gap: 1em;
* {
z-index: 1;
}
&::before {
position: absolute;
inset: 0;
content: '';
background: var(--background);
opacity: 0.6;
}
.revoke-progress-spinner {
width: 4em;
height: 4em;
}
p {
margin: 0;
}
.abort-button {
padding: 0 1em;
}
}
.selecton {
align-self: center;
}
.actions {
margin-right: 1em;
justify-self: center;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Nov 19, 8:23 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1841056
Default Alt Text
(38 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline