PageSourceSearch

https://learn-auth-redirect-nextjs.vercel.app/_next/static/chunks/…/blocked-unhandled-67ec2839a1a094af7a6a.js

js learn-auth-redirect-nextjs.vercel.app collected 2026-10-03 07:13:39 UTC 2,091 bytes, 1 lines download raw bytes

1_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[10],{"20a2":function(e,t,n){e.exports=n("nOHt")},c7gn:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return u}));var o=n("nKUr"),c=n("q1tI"),i=(n("20a2"),Object(c.createContext)());function r(e){var t=e.children,n=Object(c.useState)({error:"you are logged out, and there is no user object, and no token"}),r=n[0],u=n[1],a=Object(c.useState)(!1),s=a[0],l=a[1],d=Object(c.useState)(!0),g=d[0],h=d[1];function b(){localStorage.setItem("token","true"),l(!0),u({name:"hello",msg:"Logged in because token in localStorage"})}return Object(c.useEffect)((function(){var e=localStorage.getItem("token");console.log("token: ",e),null!==e&&void 0!==e&&b(),h(!1)}),[]),Object(o.jsx)(i.Provider,{value:{isAuthenticated:s,user:r,login:function(){l(!0),u({name:"hello",msg:"Logged in by clicking login button, you still have no token"})},logout:function(){l(!1),u({error:"you are logged out, and there is no user object, and no token"}),localStorage.removeItem("token")},loginWithToken:b,isLoading:g},children:t})}var u=function(){return Object(c.useContext)(i)}},jeO1:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var o=n("nKUr"),c=n("q1tI"),i=n("20a2"),r=n("c7gn");function u(){var e=Object(i.useRouter)(),t=Object(r.b)(),n=t.isAuthenticated,u=t.user,a=t.logout,s=t.isLoading;return Object(c.useEffect)((function(){s||n||e.push("/")}),[s,n]),Object(o.jsxs)("div",{className:"py-12 space-y-4 layout",children:[Object(o.jsx)("h1",{className:"text-red-400",children:"If you can see this, it means you are logged in"}),Object(o.jsx)("p",{children:"This page did the auth checking directly on the page file."}),Object(o.jsx)("pre",{children:JSON.stringify({isAuthenticated:n},null,2)}),Object(o.jsx)("pre",{children:JSON.stringify(u,null,2)}),Object(o.jsx)("button",{onClick:function(){return a()},children:"logout & remove token"})]})}},oaKJ:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blocked-unhandled",function(){return n("jeO1")}])}},[["oaKJ",0,2,1]]]);

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.