Skip to content
需要从 NextAuth.js v4 升级到最新版本吗?请查阅 版本升级指南
使用指南PagesBuilt-in pages

Built-in Pages

Auth.js comes by default with a set of pages that are presented to the user as they go through their authentication journey (sign up, sign in, sign out, error, etc…). This is helpful so that you don’t need to write those from scratch when using the library first time. The UI created is based on the providers specified in your configuration file.

If you do not pass a providerId, the signIn function will redirect the user to the signin page.

Sign-in Page

In this case the app has been configured with GitHub and Credentials providers.

If we added the Google provider to our Auth.js config file (./auth.ts), then a 3rd option to sign in with Google would be available.

If you’d like to build your own sign in page, checkout our guide on custom sign-in pages.