PageSourceSearch

https://citeleaf.vercel.app/_next/static/chunks/app/auth/page-563e968da86be7a6.js

js citeleaf.vercel.app collected 2026-10-03 05:16:06 UTC 10,685 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[235],{885:function(e,s,t){Promise.resolve().then(t.bind(t,6373))},6373:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return d}});var n=t(7437),a=t(7648),i=t(2265),r=t(9505),o=t(4845),l=t(280);function c(){return(0,n.jsxs)("svg",{className:"google-icon",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,n.jsx)("path",{fill:"#4285F4",d:"M23.49 12.27c0-.79-.07-1.54-.2-2.27H12v4.51h6.47a5.53 5.53 0 0 1-2.4 3.63v2.96h3.88c2.27-2.09 3.54-5.17 3.54-8.83Z"}),(0,n.jsx)("path",{fill:"#34A853",d:"M12 24c3.24 0 5.96-1.07 7.95-2.9l-3.88-2.96c-1.08.72-2.45 1.15-4.07 1.15-3.13 0-5.78-2.11-6.73-4.96H1.26v3.05A12 12 0 0 0 12 24Z"}),(0,n.jsx)("path",{fill:"#FBBC05",d:"M5.27 14.33A7.22 7.22 0 0 1 4.9 12c0-.81.13-1.6.37-2.33V6.62H1.26A12 12 0 0 0 0 12c0 1.94.46 3.78 1.26 5.38l4.01-3.05Z"}),(0,n.jsx)("path",{fill:"#EA4335",d:"M12 4.71c1.76 0 3.34.61 4.59 1.8l3.44-3.44C17.95 1.14 15.23 0 12 0A12 12 0 0 0 1.26 6.62l4.01 3.05C6.22 6.82 8.87 4.71 12 4.71Z"})]})}function u(e){return e?e.includes("Invalid login credentials")?"Incorrect email or password.":e.includes("Email not confirmed")?"Please confirm your email before signing in.":e.includes("User already registered")?"This email is already registered.":e.includes("Password should be")?"Password must be at least 8 characters.":e.includes("rate limit")?"Too many attempts. Please wait a moment.":e:"Something went wrong. Please try again."}function d(){let[e,s]=(0,i.useState)("signin"),[t,d]=(0,i.useState)(null),[m,h]=(0,i.useState)(!1),[p,g]=(0,i.useState)(!1),[f,x]=(0,i.useState)(!1),w=(0,i.useRef)(!1),b=(0,i.useCallback)(function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error";return d({text:e,type:s})},[]),j=()=>d(null),v=(0,i.useCallback)(async e=>{if(w.current)return!0;w.current=!0;try{return await (0,o._1)(e),b(o.IB,"success"),!0}catch(e){return w.current=!1,b((null==e?void 0:e.message)||"Unable to connect the Citeleaf extension. Please try again."),!1}},[b]);(0,i.useEffect)(()=>{let e=new URLSearchParams(window.location.search);"signup"===e.get("tab")&&s("signup");let t="extension"===e.get("source");async function n(e){if(!t){window.location.href="/dashboard";return}await v(e)}l.O.auth.getSession().then(e=>{let{data:{session:s}}=e;s&&n(s)});let{data:a}=l.O.auth.onAuthStateChange((e,s)=>{("SIGNED_IN"===e||"TOKEN_REFRESHED"===e)&&s&&n(s)});return()=>a.subscription.unsubscribe()},[v]);let y=async e=>{e.preventDefault(),j(),h(!0);let s=new FormData(e.currentTarget),{data:t,error:n}=await l.O.auth.signInWithPassword({email:String(s.get("email")).trim(),password:String(s.get("password"))});h(!1),n?b(u(n.message)):(0,o.az)()?t.session?await v(t.session):b("Signed in, but no Supabase session was returned for the Citeleaf extension. Please try again."):(b("Signed in! Redirecting...","success"),window.location.href="/dashboard")},N=async e=>{var s,t;e.preventDefault(),j();let n=new FormData(e.currentTarget),a=String(n.get("name")).trim(),i=String(n.get("email")).trim(),r=String(n.get("password"));if(r.length<8){b("Password must be at least 8 characters.");return}h(!0);let{data:c,error:d}=await l.O.auth.signUp({email:i,password:r,options:{data:{full_name:a},emailRedirectTo:"".concat(window.location.origin,"/dashboard")}});if(h(!1),d){b(u(d.message));return}if((null===(t=c.user)||void 0===t?void 0:null===(s=t.identities)||void 0===s?void 0:s.length)===0){b("This email is already registered. Please sign in instead.");return}c.session&&(0,o.az)()?await v(c.session):c.session?window.location.href="/dashboard":b("Almost there! Check your email to confirm your account, then sign in.","success")},C=async()=>{j();let e="https://citeleaf.vercel.app/",s=(0,o.az)()?"".concat(e,"/auth/callback?source=extension"):"".concat(e,"/auth/callback"),{error:t}=await l.O.auth.signInWithOAuth({provider:"google",options:{redirectTo:s}});t&&b(u(t.message))},S=async()=>{var e;let s=null===(e=document.getElementById("signin-email"))||void 0===e?void 0:e.value.trim();if(!s){b('Enter your email above, then click "Forgot password".');return}let{error:t}=await l.O.auth.resetPasswordForEmail(s,{redirectTo:"".concat(window.location.origin,"/auth")});t?b(u(t.message)):b("Password reset email sent! Check your inbox.","success")};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"auth-bg-accent"}),(0,n.jsxs)("div",{className:"auth-page",children:[(0,n.jsxs)(a.default,{href:"/",style:{position:"fixed",top:24,left:24,display:"flex",alignItems:"center",gap:6,fontSize:".83rem",color:"var(--text-m)",zIndex:10},children:[(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,n.jsx)("path",{d:"M19 12H5M12 5l-7 7 7 7"})}),"Back"]}),(0,n.jsxs)("div",{className:"auth-logo",children:[(0,n.jsx)(r.Z,{}),(0,n.jsx)("p",{className:"auth-subtitle",children:"Find real citations for your research instantly."})]}),(0,n.jsxs)("div",{className:"auth-card",children:[(0,n.jsxs)("div",{className:"auth-tabs",children:[(0,n.jsx)("button",{className:"auth-tab ".concat("signin"===e?"active":""),onClick:()=>{s("signin"),j()},children:"Sign In"}),(0,n.jsx)("button",{className:"auth-tab ".concat("signup"===e?"active":""),onClick:()=>{s("signup"),j()},children:"Sign Up"})]}),t&&(0,n.jsx)("div",{className:"auth-message ".concat(t.type),children:t.text}),"signin"===e?(0,n.jsxs)("form",{className:"auth-form",onSubmit:y,children:[(0,n.jsxs)("button",{type:"button",className:"btn-google",onClick:C,children:[(0,n.jsx)("span",{className:"google-icon-wrap",children:(0,n.jsx)(c,{})}),(0,n.jsx)("span",{children:"Continue with Google"})]}),(0,n.jsx)("div",{className:"auth-divider",children:(0,n.jsx)("span",{children:"or continue with email"})}),(0,n.jsxs)("div",{className:"form-group",children:[(0,n.jsx)("label",{className:"form-label",htmlFor:"signin-email",children:"Email"}),(0,n.jsx)("input",{className:"form-input",type:"email",id:"signin-email",name:"email",placeholder:"[email protected]",required:!0,autoComplete:"email"})]}),(0,n.jsxs)("div",{className:"form-group",children:[(0,n.jsx)("label",{className:"form-label",htmlFor:"signin-password",children:"Password"}),(0,n.jsxs)("div",{className:"pw-wrap",children:[(0,n.jsx)("input",{className:"form-input",type:p?"text":"password",id:"signin-password",name:"password",placeholder:"Your password",required:!0,autoComplete:"current-password",style:{paddingRight:40}}),(0,n.jsx)("button",{type:"button",className:"pw-toggle",onClick:()=>g(e=>!e),children:"Show"})]})]}),(0,n.jsx)("button",{type:"submit",className:"form-submit",disabled:m,children:m?"Please wait...":"Sign In"}),(0,n.jsx)("button",{type:"button",className:"forgot-link",onClick:S,children:"Forgot password?"})]}):(0,n.jsxs)("form",{className:"auth-form",onSubmit:N,children:[(0,n.jsxs)("button",{type:"button",className:"btn-google",onClick:C,children:[(0,n.jsx)("span",{className:"google-icon-wrap",children:(0,n.jsx)(c,{})}),(0,n.jsx)("span",{children:"Continue with Google"})]}),(0,n.jsx)("div",{className:"auth-divider",children:(0,n.jsx)("span",{children:"or continue with email"})}),(0,n.jsxs)("div",{className:"form-group",children:[(0,n.jsx)("label",{className:"form-label",htmlFor:"signup-name",children:"Full Name"}),(0,n.jsx)("input",{className:"form-input",type:"text",id:"signup-name",name:"name",placeholder:"Your name",required:!0,autoComplete:"name"})]}),(0,n.jsxs)("div",{className:"form-group",children:[(0,n.jsx)("label",{className:"form-label",htmlFor:"signup-email",children:"Email"}),(0,n.jsx)("input",{className:"form-input",type:"email",id:"signup-email",name:"email",placeholder:"[email protected]",required:!0,autoComplete:"email"})]}),(0,n.jsxs)("div",{className:"form-group",children:[(0,n.jsx)("label",{className:"form-label",htmlFor:"signup-password",children:"Password"}),(0,n.jsxs)("div",{className:"pw-wrap",children:[(0,n.jsx)("input",{className:"form-input",type:f?"text":"password",id:"signup-password",name:"password",placeholder:"At least 8 characters",required:!0,autoComplete:"new-password",minLength:"8",style:{paddingRight:40}}),(0,n.jsx)("button",{type:"button",className:"pw-toggle",onClick:()=>x(e=>!e),children:"Show"})]})]}),(0,n.jsx)("button",{type:"submit",className:"form-submit",disabled:m,children:m?"Please wait...":"Create Account"}),(0,n.jsxs)("p",{style:{fontSize:".73rem",color:"var(--text-f)",lineHeight:1.5,textAlign:"center"},children:["By signing up you agree to our ",(0,n.jsx)("a",{href:"#",style:{color:"var(--primary)"},children:"Terms"})," and ",(0,n.jsx)("a",{href:"#",style:{color:"var(--primary)"},children:"Privacy Policy"}),"."]})]})]})]})]})}},9505:function(e,s,t){"use strict";t.d(s,{Z:function(){return i}});var n=t(7437),a=t(7648);function i(e){let{href:s="/"}=e;return(0,n.jsxs)(a.default,{href:s,className:"logo",children:[(0,n.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,n.jsx)("path",{d:"M12 20c-4.4 0-8-3.6-8-8 0-3.9 2.8-7.2 6.6-7.9C12 3.8 14 3 16.2 3c2.2 0 3.8.9 3.8 3.4 0 2.6-.9 4.8-4 6.1-1.3.5-2.7.8-4 .8"}),(0,n.jsx)("path",{d:"M4 20c1.8-2.7 4.4-6.2 7-11.5"})]}),"citeleaf"]})}},4845:function(e,s,t){"use strict";t.d(s,{IB:function(){return n},_1:function(){return i},az:function(){return a}});let n="Citeleaf extension connected. You can close this tab.";function a(){return"extension"===new URLSearchParams(window.location.search).get("source")}function i(e){return new Promise((s,t)=>{var n,a;let i=null===(a=window.chrome)||void 0===a?void 0:null===(n=a.runtime)||void 0===n?void 0:n.sendMessage;if("function"!=typeof i){t(Error("Chrome extension messaging is unavailable. Open this page from the Citeleaf Chrome extension and try again."));return}let r={type:"CITELEAF_AUTH_SUCCESS",access_token:e.access_token,refresh_token:e.refresh_token,user:e.user};i.call(window.chrome.runtime,"egfngibdngghpoadmbfhkjofbfbijhen",r,e=>{var n,a;let i=null===(a=window.chrome)||void 0===a?void 0:null===(n=a.runtime)||void 0===n?void 0:n.lastError;if(i){t(Error(i.message||"The Citeleaf extension did not accept the login session."));return}if(null==e?void 0:e.error){t(Error(e.error));return}s(e)})})}},280:function(e,s,t){"use strict";t.d(s,{O:function(){return n}});let n=(0,t(5063).eI)("https://pqoxazplinnobchnmlni.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBxb3hhenBsaW5ub2JjaG5tbG5pIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzk5MjU0MTAsImV4cCI6MjA5NTUwMTQxMH0.Phrl0ZwX4tuur3WbYP9MtjnbdT0XegH6J1zaWLCxnjo")}},function(e){e.O(0,[762,648,659,971,117,744],function(){return e(e.s=885)}),_N_E=e.O()}]);

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.