
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@tailor-platform/auth
Advanced tools
This package provides ways to handle Tailor authentication
The example steps below describes how to add authentication with Tailor Platform to your app.
npm install --save @tailor-platform/auth
Create your own instance of {@link core.Config | Config }.
import { Config } from "@tailor-platform/auth/core";
export const config = new Config({
apiHost: "http://yourapp.erp.dev",
appHost: "http://localhost:3000",
});
Use {@link server.withAuth | withAuth } to add Next.js middleware with your configuration.
import { withAuth } from "@tailor-platform/auth/server";
import { config as authConfig } from "@/libs/authConfig";
const middleware = withAuth(authConfig);
export default middleware;
Use {@link client.TailorAuthProvider} to authentication on client components.
import { TailorAuthProvider } from "@tailor-platform/auth/client";
import { config } from "@/libs/authConfig";
export const Providers = ({ children }: { children: ReactNode }) => (
<TailorAuthProvider config={config}>{children}</TailorAuthProvider>
);
Use {@link client.useAuth | useAuth } hook to initiate the authentication.
"use client";
import { useAuth } from "@tailor-platform/auth/client";
const Component = async () => {
const { login } = useAuth();
const doLogin = useCallback(() => {
login({
name: "saml", // strategy name
options: {
redirectPath: "/dashboard",
},
});
}, [login]);
return (
<div>
<button onClick={doLogin}>Login</button>
</div>
);
};
This package has still more functionalities.
A set of functionss for server components ({@link server.getServerSession | getServerSession}) are also available.
A custom ApolloLink is available. See @tailor-platform/auth-apollo for more information.
Pluggable authentication adapters are supported. See {@link core.AbstractStrategy | AbstractStrategy} for more information.
FAQs
This package provides ways to handle Tailor authentication
The npm package @tailor-platform/auth receives a total of 719 weekly downloads. As such, @tailor-platform/auth popularity was classified as not popular.
We found that @tailor-platform/auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.