mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-03-02 17:21:15 +01:00
3 lines
8.6 KiB
JavaScript
3 lines
8.6 KiB
JavaScript
|
import{_ as D}from"./CopyButton-B9az3SKR.js";import{_ as O}from"./AccessLogViewer-DhKO22h5.js";import{a as Y,u as G,r as b,o as J,I as m,h as K,k as v,f as i,m as o,j as c,e as s,t as n,d as r,n as h,g as k,i as u,F as Q,D as X,U as Z,p as ee,L as se,H as d,P as M,l as f}from"./app-CzxRjCVM.js";import{u as te}from"./bus-BNAtGMCo.js";import"./SearchBox-CH3IEr_n.js";import"./Spinner-C-V0HKYn.js";/*! 2FAuth version 5.4.3 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */const ie={class:"title has-text-grey-dark mb-6"},ne={key:0,class:"has-text-centered"},oe={class:"is-size-4"},ae={key:1},re={class:"has-text-weight-light has-text-grey-dark is-pulled-right"},le={class:"subtitle is-6 block"},de={key:0,class:"notification is-dark is-size-7-mobile has-text-centered"},ce={class:"block is-size-6 is-size-7-mobile has-text-grey"},ue={class:"block"},_e={key:1,class:"title is-4 has-text-grey-light"},me={key:2,class:"block"},he={class:"list-item is-size-6 is-size-6-mobile has-text-grey"},fe={class:"mb-3 is-flex is-justify-content-space-between"},pe={class:"has-text-weight-bold"},ke={class:"tags ml-3 is-right"},ge=["title"],be=["title"],ve={class:"is-size-7 is-size-7-mobile has-text-grey-dark"},ye=["innerHTML"],we=["innerHTML"],$e=["innerHTML"],xe=["innerHTML"],ze={class:"list-item is-size-6 is-size-6-mobile has-text-grey is-flex is-justify-content-space-between"},Ce={class:"has-text-weight-bold"},Te={class:"is-block is-family-primary has-text-grey-dark"},Le={key:0},Fe={class:"tags ml-3 is-right"},Me=["title"],Be={class:"list-item is-size-6 is-size-6-mobile has-text-grey is-flex is-justify-content-space-between"},Ie={class:"has-text-weight-bold"},He={class:"is-block has-text-grey-dark"},Pe={key:0},Ue={class:"tags ml-3 is-right"},Ve=["title"],Ee={class:"block"},Ne={class:"title is-5 has-text-grey-light mb-2"},Se={key:3,class:"block is-size-6 is-size-7-mobile has-text-grey"},je={class:"title is-4 has-text-grey-light"},Ae={class:"about-debug box is-family-monospace is-size-7"},qe=["value"],Re={class:"has-text-grey"},We={class:"title is-4 has-text-danger"},De={class:"is-left-bordered-danger"},Oe={class:"block is-size-6 is-size-7-mobile"},Ye={class:"is-block has-text-grey has-text-weight-bold"},es={__name:"Manage",props:{userId:[Number,String]},setup(B){const l=Y(),I=ee(),$=G(),H=te(),x=se("2fauth"),y=b(!1),t=b(null),z=b(null),C=b(!1),w=B;J(async()=>{await P()});async function P(){y.value=!0,m.getById(w.userId,{returnError:!0}).then(e=>{t.value=e.data,H.username=t.value.info.name}).catch(e=>{l.error(e)}).finally(()=>{y.value=!1})}async function U(){if(!g())return!1;confirm(d("admin.confirm.purge_password_reset_request"))===!0&&(await m.resendPasswordEmail(t.value.info.id),t.value.password_reset=null)}async function V(){if(!g())return!1;confirm(d("admin.confirm.request_password_reset"))===!0&&m.resetPassword(t.value.info.id,{returnError:!0}).then(e=>{t.value=e.data,l.success({text:d("admin.password_successfully_reset")})}).catch(e=>{e.response.status===400?l.alert({text:e.response.data.reason}):l.error(e)})}function E(e){if(!confirm(d("admin.confirm.change_admin_role"))){M().then(()=>{t.value.info.is_admin=!e});return}if(e===!1&&t.value.info.id===$.id&&!confirm(d("admin.confirm.demote_own_account"))){M().then(()=>{t.value.info.is_admin=!0});return}m.promote(t.value.info.id,{is_admin:e},{returnError:!0}).then(a=>{t.value.info.is_admin=a.data.info.is_admin,l.success({text:d("admin.user_role_updated")})}).catch(a=>{a.response.status===403?(l.alert({text:a.response.data.message}),t.value.info.is_admin=!0):l.error(a.response)})}function N(){if(!g())return!1;confirm(d("admin.confirm.delete_account"))&&m.delete(t.value.info.id,{returnError:!0}).then(e=>{l.success({text:d("auth.forms.user_account_successfully_deleted")}),I.push({name:"admin.users"})}).catch(e=>{e.response.status===403?l.alert({text:e.response.data.message}):l.error(e.response)})}function S(){if(!g())return!1;m.revokePATs(t.value.info.id).then(e=>{t.value.valid_personal_access_tokens=0,l.success({text:d("admin.pats_succesfully_revoked")})})}function g(){return!(t.value.i
|
||
|
//# sourceMappingURL=Manage-CqjY5Ai2.js.map
|