PageSourceSearch

https://code-together-eight.vercel.app/_next/static/chunks/pages/login-105364fa5ca27d4d.js

js code-together-eight.vercel.app collected 2026-10-03 05:17:56 UTC 4,479 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[459],{7156:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return n(4984)}])},4888:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5893),s=n(8193);function a(e){var t=e.typeAlert,n=e.message;return console.log(t,n),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"container mt-5",children:(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)("div",{className:"error"==t?"alert bg-red-500 p-3 rounded-[3px] text-white":"alert bg-success p-3 rounded-[3px] text-white",children:(0,r.jsxs)("p",{className:"flex items-center text-2xl",children:[(0,r.jsx)(s.Y9U,{})," ",(0,r.jsx)("span",{className:"mx-2 text-lg",children:n})]})})})})})}},320:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5893),s=n(3990);function a(){return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"container absolute inset-0 bg-black bg-opacity-40 z-20 ",children:(0,r.jsx)("div",{className:"flex justify-center items-center w-full h-full",children:(0,r.jsx)(s.Cd,{className:"animate-spin text-white opacity-100 text-5xl"})})})})}},4984:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}});var r=n(5893),s=n(1664),a=n(7294),o=n(9669),i=n.n(o),c=n(4888),l=n(461),u=n(1803),d=n(320),x=n(1163);function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,s=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){s=!0,a=c}finally{try{r||null==i.return||i.return()}finally{if(s)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function f(){var e=(0,a.useState)(""),t=e[0],n=e[1],o=(0,a.useState)(""),f=o[0],m=o[1],p=(0,a.useState)(""),g=p[0],v=p[1],j=(0,a.useState)(""),w=j[0],y=j[1],N=h((0,l.Z)(["token"]),3),b=(N[0],N[1]),k=(N[2],h((0,l.Z)(["username"]),3)),_=(k[0],k[1]),S=(k[2],(0,a.useState)("")),E=(S[0],S[1],(0,a.useState)(!1)),C=E[0],P=E[1],Z=new Date;Z.setDate(Z.getDate()+60);var A=(0,x.useRouter)();return(0,r.jsxs)(r.Fragment,{children:[C?(0,r.jsx)(d.Z,{}):"",g&&(0,r.jsx)(c.Z,{typeAlert:w,message:g}),(0,r.jsxs)(u.E.div,{className:"container w-full mt-4",initial:{opacity:0,translateY:"100vh"},animate:{opacity:1,translateX:0,translateY:0},transition:{duration:.8},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-center mt-5 text-3xl font-bold",children:"Login"}),(0,r.jsxs)("p",{className:"text-center text-md mt-3 text-white",children:["Do not have an account ?",(0,r.jsx)(s.default,{href:"/register",children:(0,r.jsx)("a",{className:" text-blue-500 hover:text-blue-700 mx-1",children:"Register"})})]})]}),(0,r.jsx)("div",{className:"flex w-full justify-center mt-5",children:(0,r.jsxs)("div",{className:"container md:w-1/2 px-3 md:px-0",children:[(0,r.jsx)("div",{className:"grid grid-cols-1 mt-3",children:(0,r.jsx)("input",{className:"bg-offBlack rounded-[10px] p-3 ",type:"text",placeholder:"Username",value:f,onChange:function(e){return m(e.target.value)}})}),(0,r.jsx)("div",{className:"grid grid-cols-1 mt-3",children:(0,r.jsx)("input",{className:"bg-offBlack rounded-[10px] p-3 ",type:"password",placeholder:"Password",value:t,onChange:function(e){return n(e.target.value)}})}),(0,r.jsx)("button",{className:"bg-primary hover:bg-offPrimary hover:scale-[100.5%] ease-in-out duration-100 text-white rounded-[12px] px-3 py-2 font-bold w-full mt-5",onClick:function(){""==f?(y("error"),v("Please enter your username")):""==t?(y("error"),v("Please enter your password")):(P(!0),i().post("http://codetogetherback.herokuapp.com/api-token-auth/",{username:f,password:t}).then((function(e){if(console.log("res",e),200===e.status)return b("token",e.data.token,{expires:Z}),P(!1),y("success"),v("Login Successful"),m(""),n(""),e.data.token})).then((function(e){console.log("auth: ",e),i().post("http://codetogetherback.herokuapp.com/api/get_user_details/",{token:e}).then((function(e){console.log(e.data.username),_("username",e.data.username,{expires:Z}),P(!1),A.push("/createroom")}))})).catch((function(e){400===e.response.status?(y("error"),v("Invalid credentials"),console.log("err",e.response.data)):(y("error"),v("Something went wrong")),P(!1)}))),console.log(t,f)},children:"Login"})]})})]})]})}}},function(e){e.O(0,[617,609,669,474,774,888,179],(function(){return t=7156,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.