且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

nextjs路由中间件进行身份验证

更新时间:2023-12-03 10:08:46

Tim帮助我解决了这个问题.可以找到解决方法此处,但我会引用他,这样所有人都可以看到:

Tim from the next chat helped me solve this. Solution can be found here but I will quote him so you all can see:

  • You can do the check in _app.js getInitialProps and redirect like this
  • Example of how to use it
  • _app.js documentation

我还创建了一个示例骨架模板,您可以看一下.

I've also created an example skeleton template you can take a look at.