transcriptor-web/public/build/assets/LogoutOtherBrowserSessionsForm-BMipD7tw.js
2025-04-05 15:58:14 +02:00

2 lines
3.4 KiB
JavaScript

import{r as l,u as p,m as f,j as s}from"./app-43FwoUKv.js";import{c as g}from"./index-C3aXnQRR.js";import{A as w}from"./ActionMessage-BR0zIw5R.js";import{A as j}from"./Modal-Dl0HSC4q.js";import{D as a}from"./DialogModal-CM2pkQ7Q.js";import{T as v,I as y}from"./TextInput-CdoY_jBz.js";import{P as c}from"./PrimaryButton-Gixff4KF.js";import{S as k}from"./SecondaryButton-CKdOzt0Y.js";import"./transition-aKza8ZE9.js";import"./SectionTitle-CmR6E75W.js";function _({sessions:n}){const[d,i]=l.useState(!1),u=p(),r=l.useRef(null),o=f({password:""});function m(){i(!0),setTimeout(()=>{var e;return(e=r.current)==null?void 0:e.focus()},250)}function h(){o.delete(u("other-browser-sessions.destroy"),{preserveScroll:!0,onSuccess:()=>t(),onError:()=>{var e;return(e=r.current)==null?void 0:e.focus()},onFinish:()=>o.reset()})}function t(){i(!1),o.reset()}return s.jsxs(j,{title:"Browser Sessions",description:"Manage and log out your active sessions on other browsers and devices.",children:[s.jsx("div",{className:"max-w-xl text-sm text-gray-600 dark:text-gray-400",children:"If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password."}),n.length>0?s.jsx("div",{className:"mt-5 space-y-6",children:n.map((e,x)=>s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{children:e.agent.is_desktop?s.jsx("svg",{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",className:"w-8 h-8 text-gray-500",children:s.jsx("path",{d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}):s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",className:"w-8 h-8 text-gray-500",children:[s.jsx("path",{d:"M0 0h24v24H0z",stroke:"none"}),s.jsx("rect",{x:"7",y:"4",width:"10",height:"16",rx:"1"}),s.jsx("path",{d:"M11 5h2M12 17v.01"})]})}),s.jsxs("div",{className:"ml-3",children:[s.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[e.agent.platform," - ",e.agent.browser]}),s.jsx("div",{children:s.jsxs("div",{className:"text-xs text-gray-500",children:[e.ip_address,",",e.is_current_device?s.jsx("span",{className:"text-green-500 font-semibold",children:"This device"}):s.jsxs("span",{children:["Last active ",e.last_active]})]})})]})]},x))}):null,s.jsxs("div",{className:"flex items-center mt-5",children:[s.jsx(c,{onClick:m,children:"Log Out Other Browser Sessions"}),s.jsx(w,{on:o.recentlySuccessful,className:"ml-3",children:"Done."})]}),s.jsxs(a,{isOpen:d,onClose:t,children:[s.jsxs(a.Content,{title:"Log Out Other Browser Sessions",children:["Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.",s.jsxs("div",{className:"mt-4",children:[s.jsx(v,{type:"password",className:"mt-1 block w-3/4",placeholder:"Password",ref:r,value:o.data.password,onChange:e=>o.setData("password",e.currentTarget.value)}),s.jsx(y,{message:o.errors.password,className:"mt-2"})]})]}),s.jsxs(a.Footer,{children:[s.jsx(k,{onClick:t,children:"Cancel"}),s.jsx(c,{onClick:h,className:g("ml-2",{"opacity-25":o.processing}),disabled:o.processing,children:"Log Out Other Browser Sessions"})]})]})]})}export{_ as default};