logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

security_tab.vue (6875B)


  1. <template>
  2. <div :label="$t('settings.security_tab')">
  3. <div class="setting-item">
  4. <h2>{{ $t('settings.change_email') }}</h2>
  5. <div>
  6. <p>{{ $t('settings.new_email') }}</p>
  7. <input
  8. v-model="newEmail"
  9. type="email"
  10. autocomplete="email"
  11. class="input"
  12. >
  13. </div>
  14. <div>
  15. <p>{{ $t('settings.current_password') }}</p>
  16. <input
  17. v-model="changeEmailPassword"
  18. type="password"
  19. autocomplete="current-password"
  20. class="input"
  21. >
  22. </div>
  23. <button
  24. class="btn button-default"
  25. @click="changeEmail"
  26. >
  27. {{ $t('settings.save') }}
  28. </button>
  29. <p v-if="changedEmail">
  30. {{ $t('settings.changed_email') }}
  31. </p>
  32. <template v-if="changeEmailError !== false">
  33. <p>{{ $t('settings.change_email_error') }}</p>
  34. <p>{{ changeEmailError }}</p>
  35. </template>
  36. </div>
  37. <div class="setting-item">
  38. <h2>{{ $t('settings.change_password') }}</h2>
  39. <div>
  40. <p>{{ $t('settings.current_password') }}</p>
  41. <input
  42. v-model="changePasswordInputs[0]"
  43. type="password"
  44. class="input"
  45. >
  46. </div>
  47. <div>
  48. <p>{{ $t('settings.new_password') }}</p>
  49. <input
  50. v-model="changePasswordInputs[1]"
  51. type="password"
  52. class="input"
  53. >
  54. </div>
  55. <div>
  56. <p>{{ $t('settings.confirm_new_password') }}</p>
  57. <input
  58. v-model="changePasswordInputs[2]"
  59. type="password"
  60. class="input"
  61. >
  62. </div>
  63. <button
  64. class="btn button-default"
  65. @click="changePassword"
  66. >
  67. {{ $t('settings.save') }}
  68. </button>
  69. <p v-if="changedPassword">
  70. {{ $t('settings.changed_password') }}
  71. </p>
  72. <p v-else-if="changePasswordError !== false">
  73. {{ $t('settings.change_password_error') }}
  74. </p>
  75. <p v-if="changePasswordError">
  76. {{ changePasswordError }}
  77. </p>
  78. </div>
  79. <div class="setting-item">
  80. <h2>{{ $t('settings.oauth_tokens') }}</h2>
  81. <table class="oauth-tokens">
  82. <thead>
  83. <tr>
  84. <th>{{ $t('settings.app_name') }}</th>
  85. <th>{{ $t('settings.valid_until') }}</th>
  86. <th />
  87. </tr>
  88. </thead>
  89. <tbody>
  90. <tr
  91. v-for="oauthToken in oauthTokens"
  92. :key="oauthToken.id"
  93. >
  94. <td>{{ oauthToken.appName }}</td>
  95. <td>{{ oauthToken.validUntil }}</td>
  96. <td class="actions">
  97. <button
  98. class="btn button-default"
  99. @click="revokeToken(oauthToken.id)"
  100. >
  101. {{ $t('settings.revoke_token') }}
  102. </button>
  103. </td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. </div>
  108. <mfa />
  109. <div class="setting-item">
  110. <h2>{{ $t('settings.account_alias') }}</h2>
  111. <table>
  112. <thead>
  113. <tr>
  114. <th>{{ $t('settings.account_alias_table_head') }}</th>
  115. <th />
  116. </tr>
  117. </thead>
  118. <tbody>
  119. <tr
  120. v-for="alias in aliases"
  121. :key="alias"
  122. >
  123. <td>{{ alias }}</td>
  124. <td class="actions">
  125. <button
  126. class="btn button-default"
  127. @click="removeAlias(alias)"
  128. >
  129. {{ $t('settings.remove_alias') }}
  130. </button>
  131. </td>
  132. </tr>
  133. </tbody>
  134. </table>
  135. <div
  136. v-if="listAliasesError"
  137. class="alert error"
  138. >
  139. {{ $t('settings.list_aliases_error', { error }) }}
  140. <FAIcon
  141. class="fa-scale-110 fa-old-padding"
  142. icon="times"
  143. :title="$t('settings.hide_list_aliases_error_action')"
  144. @click="listAliasesError = false"
  145. />
  146. </div>
  147. <div>
  148. <i18n-t
  149. keypath="settings.new_alias_target"
  150. tag="p"
  151. >
  152. <code
  153. place="example"
  154. >
  155. foo@example.org
  156. </code>
  157. </i18n-t>
  158. <input
  159. v-model="addAliasTarget"
  160. class="input"
  161. >
  162. </div>
  163. <button
  164. class="btn button-default"
  165. @click="addAlias"
  166. >
  167. {{ $t('settings.save') }}
  168. </button>
  169. <p v-if="addedAlias">
  170. {{ $t('settings.added_alias') }}
  171. </p>
  172. <template v-if="addAliasError !== false">
  173. <p>{{ $t('settings.add_alias_error', { error: addAliasError }) }}</p>
  174. </template>
  175. </div>
  176. <div class="setting-item">
  177. <h2>{{ $t('settings.move_account') }}</h2>
  178. <p>{{ $t('settings.move_account_notes') }}</p>
  179. <div>
  180. <i18n-t
  181. keypath="settings.move_account_target"
  182. tag="p"
  183. >
  184. <template #example>
  185. <code>
  186. foo@example.org
  187. </code>
  188. </template>
  189. </i18n-t>
  190. <input
  191. v-model="moveAccountTarget"
  192. class="input"
  193. >
  194. </div>
  195. <div>
  196. <p>{{ $t('settings.current_password') }}</p>
  197. <input
  198. v-model="moveAccountPassword"
  199. type="password"
  200. autocomplete="current-password"
  201. class="input"
  202. >
  203. </div>
  204. <button
  205. class="btn button-default"
  206. @click="moveAccount"
  207. >
  208. {{ $t('settings.save') }}
  209. </button>
  210. <p v-if="movedAccount">
  211. {{ $t('settings.moved_account') }}
  212. </p>
  213. <template v-if="moveAccountError !== false">
  214. <p>{{ $t('settings.move_account_error', { error: moveAccountError }) }}</p>
  215. </template>
  216. </div>
  217. <div class="setting-item">
  218. <h2>{{ $t('settings.delete_account') }}</h2>
  219. <p v-if="!deletingAccount">
  220. {{ $t('settings.delete_account_description') }}
  221. </p>
  222. <div v-if="deletingAccount">
  223. <p>{{ $t('settings.delete_account_instructions') }}</p>
  224. <p>{{ $t('login.password') }}</p>
  225. <input
  226. v-model="deleteAccountConfirmPasswordInput"
  227. type="password"
  228. class="input"
  229. >
  230. <button
  231. class="btn button-default"
  232. @click="deleteAccount"
  233. >
  234. {{ $t('settings.delete_account') }}
  235. </button>
  236. </div>
  237. <p v-if="deleteAccountError !== false">
  238. {{ $t('settings.delete_account_error') }}
  239. </p>
  240. <p v-if="deleteAccountError">
  241. {{ deleteAccountError }}
  242. </p>
  243. <button
  244. v-if="!deletingAccount"
  245. class="btn button-default"
  246. @click="confirmDelete"
  247. >
  248. {{ $t('settings.delete_account') }}
  249. </button>
  250. </div>
  251. </div>
  252. </template>
  253. <script src="./security_tab.js"></script>
  254. <!-- <style lang="scss" src="./profile.scss"></style> -->