The Payload app has both admin and front-end in a single NextJS project, this plugin supports both admin and front-end side authentication. As per the latest update this plugin only supports authentication within the Payload app.


NextJS config

If you are using OAuth providers then it is mandatory to add a header to the nextConfig. This is a workaround and can be removed in future.


tsnext.config.js
            const nextConfig = {
  //--- rest of the config
  async headers() {
    return [
      {
        source: "/(.*)",
        headers: [
          {
            key: "Cross-Origin-Opener-Policy",
            value: "same-origin-allow-popups",
          },
        ],
      },
    ];
  },
};

        

In near future releases, this plugin will also support authentication for front-end apps outside Payload.