Initiates the authentication process.
"use client";
import { useAuth } from "@tailor-platform/auth/client";
const Component = async () => {
const { login } = useAuth();
const doLogin = useCallback(() => {
login({
options: {
redirectPath: "/dashboard",
},
});
}, [login]);
return (
<div>
<button onClick={doLogin}>Login</button>
</div>
);
};
Optional
params: LoginParamsSigns out a user: deletes the session token and redirects to the specified page.
"use client";
import { useAuth } from "@tailor-platform/auth/client";
const Component = async () => {
const { logout } = useAuth();
return (
<div>
<button onClick={() => logout()}>Logout</button>
</div>
);
};
Optional
params: LogoutParamsGenerated using TypeDoc
A hook that provides authorization functionality for clients