logo

pleroma-fe

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

security_tab.vue (6925B)


  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. scope="global"
  150. keypath="settings.new_alias_target"
  151. tag="p"
  152. >
  153. <code
  154. place="example"
  155. >
  156. foo@example.org
  157. </code>
  158. </i18n-t>
  159. <input
  160. v-model="addAliasTarget"
  161. class="input"
  162. >
  163. </div>
  164. <button
  165. class="btn button-default"
  166. @click="addAlias"
  167. >
  168. {{ $t('settings.save') }}
  169. </button>
  170. <p v-if="addedAlias">
  171. {{ $t('settings.added_alias') }}
  172. </p>
  173. <template v-if="addAliasError !== false">
  174. <p>{{ $t('settings.add_alias_error', { error: addAliasError }) }}</p>
  175. </template>
  176. </div>
  177. <div class="setting-item">
  178. <h2>{{ $t('settings.move_account') }}</h2>
  179. <p>{{ $t('settings.move_account_notes') }}</p>
  180. <div>
  181. <i18n-t
  182. keypath="settings.move_account_target"
  183. tag="p"
  184. scope="global"
  185. >
  186. <template #example>
  187. <code>
  188. foo@example.org
  189. </code>
  190. </template>
  191. </i18n-t>
  192. <input
  193. v-model="moveAccountTarget"
  194. class="input"
  195. >
  196. </div>
  197. <div>
  198. <p>{{ $t('settings.current_password') }}</p>
  199. <input
  200. v-model="moveAccountPassword"
  201. type="password"
  202. autocomplete="current-password"
  203. class="input"
  204. >
  205. </div>
  206. <button
  207. class="btn button-default"
  208. @click="moveAccount"
  209. >
  210. {{ $t('settings.save') }}
  211. </button>
  212. <p v-if="movedAccount">
  213. {{ $t('settings.moved_account') }}
  214. </p>
  215. <template v-if="moveAccountError !== false">
  216. <p>{{ $t('settings.move_account_error', { error: moveAccountError }) }}</p>
  217. </template>
  218. </div>
  219. <div class="setting-item">
  220. <h2>{{ $t('settings.delete_account') }}</h2>
  221. <p v-if="!deletingAccount">
  222. {{ $t('settings.delete_account_description') }}
  223. </p>
  224. <div v-if="deletingAccount">
  225. <p>{{ $t('settings.delete_account_instructions') }}</p>
  226. <p>{{ $t('login.password') }}</p>
  227. <input
  228. v-model="deleteAccountConfirmPasswordInput"
  229. type="password"
  230. class="input"
  231. >
  232. <button
  233. class="btn button-default"
  234. @click="deleteAccount"
  235. >
  236. {{ $t('settings.delete_account') }}
  237. </button>
  238. </div>
  239. <p v-if="deleteAccountError !== false">
  240. {{ $t('settings.delete_account_error') }}
  241. </p>
  242. <p v-if="deleteAccountError">
  243. {{ deleteAccountError }}
  244. </p>
  245. <button
  246. v-if="!deletingAccount"
  247. class="btn button-default"
  248. @click="confirmDelete"
  249. >
  250. {{ $t('settings.delete_account') }}
  251. </button>
  252. </div>
  253. </div>
  254. </template>
  255. <script src="./security_tab.js"></script>
  256. <!-- <style lang="scss" src="./profile.scss"></style> -->