pleroma-fe/src/components/settings_modal/tabs/security_tab/security_tab.vue

144 lines
3.8 KiB
Vue
Raw Normal View History

2020-05-03 16:36:12 +02:00
<template>
2020-05-25 02:43:55 +02:00
<div :label="$t('settings.security_tab')">
<div class="setting-item">
<h2>{{ $t('settings.change_email') }}</h2>
<div>
<p>{{ $t('settings.new_email') }}</p>
<input
v-model="newEmail"
type="email"
autocomplete="email"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
</div>
<div>
<p>{{ $t('settings.current_password') }}</p>
<input
v-model="changeEmailPassword"
type="password"
autocomplete="current-password"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
</div>
<button
class="btn btn-default"
@click="changeEmail"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
{{ $t('general.submit') }}
</button>
<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>
</div>
2020-05-03 16:36:12 +02:00
2020-05-25 02:43:55 +02:00
<div class="setting-item">
<h2>{{ $t('settings.change_password') }}</h2>
<div>
<p>{{ $t('settings.current_password') }}</p>
<input
v-model="changePasswordInputs[0]"
type="password"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
</div>
<div>
<p>{{ $t('settings.new_password') }}</p>
<input
v-model="changePasswordInputs[1]"
type="password"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
</div>
<div>
<p>{{ $t('settings.confirm_new_password') }}</p>
<input
v-model="changePasswordInputs[2]"
type="password"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
</div>
<button
class="btn btn-default"
@click="changePassword"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
{{ $t('general.submit') }}
</button>
<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>
</div>
2020-05-03 16:36:12 +02:00
2020-05-25 02:43:55 +02:00
<div class="setting-item">
<h2>{{ $t('settings.oauth_tokens') }}</h2>
<table class="oauth-tokens">
<thead>
<tr>
<th>{{ $t('settings.app_name') }}</th>
<th>{{ $t('settings.valid_until') }}</th>
<th />
</tr>
</thead>
<tbody>
<tr
v-for="oauthToken in oauthTokens"
:key="oauthToken.id"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
<td>{{ oauthToken.appName }}</td>
<td>{{ oauthToken.validUntil }}</td>
<td class="actions">
<button
class="btn btn-default"
@click="revokeToken(oauthToken.id)"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
{{ $t('settings.revoke_token') }}
</button>
</td>
</tr>
</tbody>
</table>
</div>
<mfa />
<div class="setting-item">
<h2>{{ $t('settings.delete_account') }}</h2>
<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"
>
<button
class="btn btn-default"
@click="deleteAccount"
2020-05-03 16:36:12 +02:00
>
2020-05-25 02:43:55 +02:00
{{ $t('settings.delete_account') }}
</button>
</div>
<p v-if="deleteAccountError !== false">
{{ $t('settings.delete_account_error') }}
</p>
<p v-if="deleteAccountError">
{{ deleteAccountError }}
</p>
2020-05-03 16:36:12 +02:00
<button
2020-05-25 02:43:55 +02:00
v-if="!deletingAccount"
2020-05-03 16:36:12 +02:00
class="btn btn-default"
2020-05-25 02:43:55 +02:00
@click="confirmDelete"
>
{{ $t('general.submit') }}
2020-05-03 16:36:12 +02:00
</button>
</div>
</div>
</template>
<script src="./security_tab.js"></script>
2020-05-03 16:36:12 +02:00
<!-- <style lang="scss" src="./profile.scss"></style> -->