PageSourceSearch

https://mobilizon.fr/assets/LoginView-BEoqiL0I.js

js mobilizon.fr collected 2026-09-24 18:56:01 UTC 5,184 bytes, 2 lines download raw bytes

1import{e as Y,f as j,ao as J,bJ as K,bK as $,a as X,I as Z,Y as D,bL as ee,ay as ae,az as oe,aB as te,k as e,j as _,i as N,t as s,ak as S,h as E,w as r,v as i,bM as P,o as f,a4 as re,av as se,s as n,R as h,aw as ne,bB as le,c,a7 as V,aC as ie,bN as ue,F as L,bO as de,x as l,C as ce,b8 as me}from"./main-BvDl5GqJ.js";import{_ as ge}from"./AuthProviders.vue_vue_type_script_setup_true_lang-CmEn8jMU.js";import{u as pe}from"./head-BvuADw2P.js";import{u as q,e as ve}from"./index-BGojD3NO.js";const _e={key:0,class:"container mx-auto max-w-screen-sm"},fe={class:"text-4xl"},ye={class:"text-center my-2"},we={class:"flex flex-wrap gap-2 mt-3"},be={key:0,class:"control"},Ee={key:4},Ie=Y({__name:"LoginView",setup(he){const{t:a}=j({useScope:"global"}),R=ne(),g=le(),{currentUser:C}=J(),{identities:O}=K(),A=$(),G=X(ce),u=c(()=>G.result.value?.config),M=c(()=>(u.value?.registrationsOpen||u.value?.registrationsAllowlist)&&u.value?.auth?.databaseLogin),y=V([]),p=V(!1),t=Z({email:typeof g.query.email=="string"?g.query.email:"",password:typeof g.query.password=="string"?g.query.password:""}),k=q("redirect",""),I=q("code",null,ve(S)),Q=D(ee),B=D(ae),F=oe(de),W=async v=>{if(v.preventDefault(),!p.value){p.value=!0,y.value=[];try{A.client.resetStore();const{data:o}=await Q.mutate({email:t.email,password:t.password});if(p.value=!1,o==null)throw new Error("Login: user's data is undefined");ie(o.login),await B.mutate({id:o.login.user.id,email:t.email,isLoggedIn:!0,role:o.login.user.role});const w=await F.load();if(ue(w?.loggedUser?.settings?.location),O.value&&O.value.length<1){console.debug("no identities, a redirection to CREATE_IDENTITY has already been done by App.vue");return}if(k.value){console.debug("We have a redirect",k.value),R.push(k.value);return}console.debug("No redirect, going to homepage"),window.localStorage&&(console.debug("Has localstorage, setting welcome back"),window.localStorage.setItem("welcome-back","yes")),R.replace({name:h.HOME})}catch(o){console.error(o),p.value=!1,o.graphQLErrors?o.graphQLErrors.forEach(({message:d})=>{y.value.push(d)}):o.networkError&&y.value.push(o.networkError.message)}}},x=c(()=>t.email!==t.email.toLowerCase()),H=c(()=>{if(x.value)return a("Emails usually don't contain capitals, make sure you haven't made a typo.")}),z=c(()=>
1{if(x.value)return"warning"}),U=c(()=>{const v=g?.query.provider;return v?me[v]:"unknown provider"});return te(()=>{C.value?.isLoggedIn&&(console.debug("Current user is already logged-in, redirecting to Homepage",C.value),R.push("/"))}),pe({title:c(()=>a("Login"))}),(v,o)=>{const d=L("o-notification"),w=L("o-input"),T=L("o-field"),b=L("o-button");return e(C)?.isLoggedIn?f("",!0):(l(),_("section",_e,[N("h1",fe,s(e(a)("Welcome back!")),1),e(I)===e(S).NEED_TO_LOGIN?(l(),E(d,{key:0,title:"Info",variant:"info","aria-close-label":e(a)("Close")},{default:r(()=>[i(s(e(a)("You need to login.")),1)]),_:1},8,["aria-close-label"])):e(I)===e(P).LOGIN_PROVIDER_ERROR?(l(),E(d,{key:1,variant:"danger","aria-close-label":e(a)("Close")},{default:r(()=>[i(s(e(a)("Error while login with {provider}. Retry or login another way.",{provider:U.value})),1)]),_:1},8,["aria-close-label"])):e(I)===e(P).LOGIN_PROVIDER_NOT_FOUND?(l(),E(d,{key:2,variant:"danger","aria-close-label":e(a)("Close")},{default:r(()=>[i(s(e(a)("Error while login with {provider}. This login provider doesn't exist.",{provider:U.value})),1)]),_:1},8,["aria-close-label"])):f("",!0),(l(!0),_(re,null,se(y.value,m=>(l(),E(d,{title:e(a)("Error"),variant:"danger",key:m},{default:r(()=>[i(s(m),1)]),_:2},1032,["title"]))),128)),u.value?.auth?.databaseLogin?(l(),_("form",{key:3,onSubmit:W},[n(T,{label:e(a)("Email"),"label-for":"email",message:H.value,type:z.value},{default:r(()=>[n(w,{"aria-required":"true",required:"",expanded:"",id:"email",type:"email",modelValue:t.email,"onUpdate:modelValue":o[0]||(o[0]=m=>t.email=m)},null,8,["modelValue"])]),_:1},8,["label","message","type"]),n(T,{label:e(a)("Password"),"label-for":"password"},{default:r(()=>[n(w,{"aria-required":"true",id:"password",required:"",expanded:"",type:"password","password-reveal":"",modelValue:t.password,"onUpdate:modelValue":o[1]||(o[1]=m=>t.password=m)},null,8,["modelValue"])]),_:1},8,["label"]),N("p",ye,[n(b,{variant:"primary",size:"large",type:"submit",disabled:p.value},{default:r(()=>[i(s(e(a)("Login")),1)]),_:1},8,["disabled"])]),N("div",we,[n(b,{tag:"router-link",variant:"text",to:{name:e(h).SEND_PASSWORD_RESET,params:{email:t.email}}},{default:r(()=>[i(s(e(a)("Reset your password")),1)]),_:1},8,["to"]),n(b,{tag:"router-link",variant:"text",to:{name:e(h).RESEND_CONFIRMATION,params:{email:t.email}}},{default:r(()=>[i(s(e(a)("Didn't receive the instructions?")),1)]),_:1},8,["to"]),M.value?(l(),_("p",be,[n(b,{tag:"router-link",variant:"text",to:{name:e(h).REGISTER,query:{default_email:t.email,default_password:t.password}}},{default:r(()=>[i(s(e(a)("Create an account")),1)]),_:1},8,["to"])])):f("",!0)])],32)):f("",!0),u.value&&u.value?.auth?.oauthProviders?.length>0?(l(),_("div",Ee,[n(ge,{oauthProviders:u.value.auth.oauthProviders},null,8,["oauthProviders"])])):f("",!0)]))}}});
1export{Ie as default};
2//# sourceMappingURL=LoginView-BEoqiL0I.js.map

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.