1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9498],{83313:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/auth",function(){return t(10976)}])},26054:function(e,n,t){"use strict";t.d(n,{Y:function(){return a}});var r=t(85893),s=t(67294),i=t(37174),o=t(52435),d=t(79381);const a=s.forwardRef(((e,n)=>{let{className:t,...s}=e;const{data:a,isLoading:l,error:c}=o.S.tenantUser.get.useQuery();return l&&!c?(0,r.jsx)("div",{children:(0,r.jsx)(d.g,{active:l})}):"ADMIN"!==(null===a||void 0===a?void 0:a.role)||!a||c?(0,r.jsxs)("div",{className:"bg-background dark:bg-background-10 text-foreground m-4 rounded-md p-6 shadow sm:overflow-hidden",children:[(0,r.jsx)("h1",{className:"mb-1 text-2xl font-medium",children:"Unable to Access Admin"}),(0,r.jsx)("p",{className:"text-sm",children:"This page is only for administrators, but your user role is not administrator. Please try again later. If this issue keeps happening, contact our customer support."})]}):(0,r.jsx)("div",{ref:n,className:(0,i.cn)("container mb-5 max-w-4xl",t),...s})}));a.displayName="AdminPageContainer"},3014:function(e,n,t){"use strict";t.d(n,{NI:function(){return p},Wi:function(){return u},l0:function(){return l},lX:function(){return h},pf:function(){return g},xJ:function(){return x},zG:function(){return j}});var r=t(85893),s=t(88426),i=t(67294),o=t(87536),d=t(37174),a=t(18396);const l=o.RV,c=i.createContext({}),u=e=>{let{...n}=e;return(0,r.jsx)(c.Provider,{value:{name:n.name},children:(0,r.jsx)(o.Qr,{...n})})},m=()=>{const e=i.useContext(c),n=i.useContext(f),{getFieldState:t,formState:r}=(0,o.Gc)(),s=t(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:d}=n;return{id:d,name:e.name,formItemId:"".concat(d,"-form-item"),formDescriptionId:"".concat(d,"-form-item-description"),formMessageId:"".concat(d,"-form-item-message"),...s}},f=i.createContext({}),x=i.forwardRef(((e,n)=>{let{className:t,...s}=e;const o=i.useId();return(0,r.jsx)(f.Provider,{value:{id:o},children:(0,r.jsx)("div",{ref:n,className:(0,d.cn)("space-y-2",t),...s})})}));x.displayName="FormItem";const h=i.forwardRef(((e,n)=>{let{className:t,...s}=e;const{error:i,formItemId:o}=m();return(0,r.jsx)(a._,{ref:n,className:(0,d.cn)(i&&"text-destructive",t),htmlFor:o,...s})}));h.displayName="FormLabel";const p=i.forwardRef(((e,n)=>{let{...t}=e;const{error:i,formItemId:o,formDescriptionId:d,formMessageId:a}=m();return(0,r.jsx)(s.g7,{ref:n,id:o,"aria-describedby":i?"".concat(d," ").concat(a):"".concat(d),"aria-invalid":!!i,...t})}));p.displayName="FormControl";const g=i.forwardRef(((e,n)=>{let{className:t,...s}=e;const{formDescriptionId:i}=m();return(0,r.jsx)("p",{ref:n,id:i,className:(0,d.cn)("text-muted-foreground text-sm",t),...s})}));g.displayName="FormDescription";const j=i.forwardRef(((e,n)=>{let{className:t,children:s,...i}=e;const{error:o,formMessageId:a}=m(),l=o?String(null===o||void 0===o?void 0:o.message):s;return l?(0,r.jsx)("p",{ref:n,id:a,className:(0,d.cn)("text-warning text-sm font-medium",t),...i,children:l}):null}));j.displayName="FormMessage"},84472:function(e,n,t){"use strict";t.d(n,{I:function(){return o}});var r=t(85893),s=t(67294),i=t(37174);const o=s.forwardRef(((e,n)=>{let{className:t,type:s,...o}=e;return(0,r.jsx)("input",{type:s,className:(0,i.cn)("box-border block w-full rounded-md py-2 pl-3 pr-3 text-sm transition-all","border-background-20 bg-background dark:bg-background-10 text-foreground rounded-md border border-solid shadow-none transition-all focus:outline-none focus:ring-0","placeholder:text-foreground-10 disabled:text-background-10 disabled:cursor-not-allowed",t),ref:n,...o})}));o.displayName="Input"},10976:function(e,n,t){"use strict";t.r(n);var r=t(85893),s=t(56312),i=t(70385),o=t(2962),d=t(67294),a=t(64415),l=t(43808),c=t(87536),u=t(86501),m=t(40163),f=t(52435),x=t(1604),h=t(26054),p=t(18922),g=t(53766),j=t(92395),v=t(79381),b=t(3014),I=t(84472);const N=x.z.object({linkedInClientId:x.z.string().nonempty(),linkedInClientSecret:x.z.string().nonempty()}).or(x.z.object({linkedInClientId:x.z.literal(""),linkedInClientSecret:x.z.literal("")})),k=()=>{const[e,n]=(0,d.useState)(!1),t=f.S.useContext(),{data:m}=f.S.tenant.get.useQuery({getOAuthProviders:!0}),{data:x,isLoading:k}=f.S.tenantUser.get.useQuery(),y=null===m||void 0===m?void 0:m.oauthProviders.find((e=>e.provider===i.OAuthProviderName.linkedin)),C=(0,d.useMemo)((()=>({linkedInClientId:(null===y||void 0===y?void 0:y.clientId)||"",linkedInClientSecret:(null===y||void 0===y?void 0:y.clientSecret)||""})),[y]),w=(0,c.cI)({resolver:(0,s.F)(N),defaultValues:C}),{control:S,handleSubmit:F,reset:P,formState:z}=w;(0,d.useEffect)((()=>{P(C)}),[C,P]);const{mutate:A,isLoading:_}=f.S.tenant.update.useMutation({onSuccess:()=>{u.ZP.success("Authentication providers saved"),t.invalidate()},onError:()=>{u.ZP.error("Failed to save")}});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.PB,{title:"Authentication Providers",noindex:!0}),(0,r.jsx)(h.Y,{children:(0,r.jsx)("main",{children:(0,r.jsx)(v.g,{active:k,children:"ADMIN"===(null===x||void 0===x?void 0:x.role)?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(g.Zb,{edgeToEdgeMobile:!0,children:(0,r.jsx)(g.aY,{children:(0,r.jsxs)("div",{className:"f space-y-6",children:[(0,r.jsx)("h1",{className:"text-lg font-medium",children:"Authentication Providers"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-md font-medium",children:"LinkedIn OAuth"}),(0,r.jsx)(b.l0,{...w,children:(0,r.jsxs)("form",{onSubmit:F((e=>{A({linkedInClientId:e.linkedInClientId,linkedInClientSecret:e.linkedInClientSecret})})),children:[(0,r.jsx)(b.Wi,{control:S,name:"linkedInClientId",render:e=>{let{field:n}=e;return(0,r.jsxs)(b.xJ,{children:[(0,r.jsx)(b.lX,{children:"Client Id"}),(0,r.jsx)(b.NI,{children:(0,r.jsx)(I.I,{...n,autoComplete:"off",autoCapitalize:"off"})}),(0,r.jsx)(b.zG,{})]})}}),(0,r.jsx)(b.Wi,{control:S,name:"linkedInClientSecret",render:t=>{let{field:s}=t;return(0,r.jsxs)(b.xJ,{children:[(0,r.jsx)(b.lX,{children:"Client Secret"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(b.NI,{children:(0,r.jsx)(I.I,{...s,autoComplete:"off",autoCapitalize:"off",type:e?"text":"password"})}),(0,r.jsx)(p.z,{icon:e?(0,r.jsx)(a.Z,{}):(0,r.jsx)(l.Z,{}),onClick:()=>n(!e),type:"icon"})]}),(0,r.jsx)(b.zG,{})]})}}),(0,r.jsx)("div",{className:"bg-background dark:bg-background-10 flex items-center justify-end py-3 text-right ",children:(0,r.jsx)(p.z,{type:"primary",size:"medium",htmlType:"submit",icon:(0,r.jsx)(j.kxn,{}),loading:_,disabled:_||!z.isDirty,children:"Save"})})]})})]})]})})})}):(0,r.jsxs)("div",{className:"bg-background dark:bg-background-10 text-foreground m-4 rounded-md p-6 shadow sm:overflow-hidden",children:[(0,r.jsx)("h1",{className:"mb-1 text-2xl font-medium",children:"Unable to Access Admin"}),(0,r.jsx)("p",{className:"text-sm",children:"This page is only for administrators, but your user role is not administrator. Please try again later. If this issue keeps happening, contact our customer support."})]})})})})]})};k.getLayout=function(e){return(0,r.jsx)(m.Z,{children:e})},n.default=k}},function(e){e.O(0,[6911,3662,1664,108,5216,9332,8394,2039,1818,8214,7913,6309,9774,2888,179],(function(){return n=83313,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.