PageSourceSearch

https://app.stewdy.com/_nuxt/-EmMPUtY.js

js stewdy.com collected 2026-10-03 19:45:20 UTC 2,857 bytes, 1 lines download raw bytes

1import{u as L}from"./xkIdePKz.js";import{h,u as x,i as b,r as p}from"./JG84WnTm.js";import{a as E,_ as O,p as $,h as q,b as A,f as F}from"./CTBbigI6.js";import{_ as N}from"./CMHNq1VI.js";import{T as P}from"./Byos5IIJ.js";import{v as R,d as G,j as M,m as s,p as m,F as B,r as C,T as I,l as U}from"./sq8n79Zx.js";import{u as W}from"./DYBFV6ql.js";import{u as z}from"./F_m7N3oO.js";import"./D6ltPAd4.js";import"./CGWH6Nkj.js";import"./D-HGYi4c.js";import"./xCUarhZb.js";import"./Coq0eRD_.js";import"./D_VUBbIQ.js";import"./DlAUqK2U.js";const V={class:"auth-page-shell"},j={class:"auth-page-panel ios-scroll"},D={class:"w-full max-w-md p-4 md:p-8 auth-content"},ge=R({__name:"index",setup(Q){const o=x("index"),u=C(!1);L();const r=W();h();const f=I();G(()=>{E(f,r,o)});const w=async t=>{u.value=!0;try{const e=await $(t);if(!e.success){q(e,r);return}const n=A(e,r);if(!n)return;const{user:a,session:_,isFirstLogin:y,loginMethod:H,studentInfo:S}=n;b().auth.setSession(_).catch(d=>{o.error("Erreur lors de la définition de session:",d)}),await new Promise(d=>setTimeout(d,800));const i=await F(r,y,S,a,o);if(!i)return;const c=f.query.redirect;if(c&&c.startsWith("/dashboard/")){window.location.href=c;return}let l="";switch(i){case"eleve":if(a.user_metadata?.must_change_password===!0){window.location.href="/auth/change-password?required=true";return}try{const{needsOnboarding:g,getStartingStep:T}=h();if(await g(a.id)){const k=await T(a.id);window.location.href=`/auth/onboarding?step=${k}`;return}}catch(g){o.error("Erreur vérification onboarding:",g)}l=p("eleve");break;case"parent":case"enseignant":case"admin":case"super_admin":case"groupe":l=p(i);break;default:o.warn(`Type d'utilisateur non reconnu: ${i}`),r.error(`Type d'utilisateur non reconnu (${i}). Contactez l'administrateur.`),l=p(i,"/dashboard/student");break}window.location.href=l}catch(e){const n=e instanceof Error?e.message:"Une erreur est survenue";o.error("Erreur lors de la connexion:",e),r.error(n)}finally{u.value=!1}},v=async()=>{u.value=!0;try{const{isNativePlatform:t,signInWithGoogleNative:e}=z();if(t()){await e({callbackPath:"/auth/callback"});return}const n=b(),{error:a}=await n.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/auth/callback`}});a&&r.error(a.message)}catch(t){const e=t instanceof Error?t.message:"Une erreur est survenue";r.error(e),u.value=!1}};return(t,e)=>(U(),M(B,null,[s("div",V,[e[0]||(e[0]=s("div",{class:"gradient-decoration-top-left"},null,-1)),e[1]||(e[1]=s("div",{class:"gradient-decoration-top-left-small"},null,-1)),e[2]||(e[2]=s("div",{class:"gradient-decoration-bottom-right"},null,-1)),e[3]||(e[3]=s("div",{class:"gradient-decoration-bottom-right-small"},null,-1)),m(N),s("div",j,[s("div",D,[m(O,{loading:u.value,onSubmit:w,onGoogleLogin:v},null,8,["loading"])])])]),m(P)],64))}});export{ge as default};

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.