@lineuxyz/next-auth-server-side
v1.0.5
Published
A library designed to facilitate server-side rendered authentication with Next.js. It helps developers handle authentication tokens, catch request errors, and manage redirections seamlessly
Downloads
1
Maintainers
Readme
next-auth-server-side: SSR Authentication Helper
Next auth server side
is a library designed to facilitate server-side rendered authentication with Next.js. It helps developers handle authentication tokens, catch request errors, and manage redirections seamlessly.
Installation
To install the library:
NPM
npm install @lineuxyz/next-auth-server-side --save
Yarn
yarn add @lineuxyz/next-auth-server-side --save
Usage
Here's a practical example of how to use the library:
import { serverSideAuthenticated } from "@lineuxyz/next-auth-server-side";
export const getServerSideProps = serverSideAuthenticated(
async () => {
const response = await axios.get('/your-path')
return { props: { yourData: response } };
},
{
cookieName: "your-cookie-name",
// Other configuration options...
}
);
Configuration Properties
tokenFailed & requestFailed Details
Contributing
We welcome contributions from developers! If you'd like to contribute, here's how you can get started:
- Fork the Repository: Fork the
@lineuxyz/next-auth-server-side
repository to your own GitHub account. - Clone the Forked Repository: Clone your fork locally on your machine.
- Install Dependencies: Navigate to the project root and run
npm install
oryarn add
. - Make Your Changes: Implement your features or fixes.
- Test Your Changes: Ensure that your changes do not introduce any bugs.
- Submit a Pull Request: Once done, push your changes to your fork on GitHub and submit a pull request.