Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LoaderFunctionArgs and ActionFunctionArgs instead in jsdoc #282

Merged
merged 1 commit into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/authenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ export class Authenticator<User = unknown> {
* Call this to authenticate a request using some strategy. You pass the name
* of the strategy you want to use and the request to authenticate.
* @example
* async function action({ request }: ActionArgs) {
* async function action({ request }: ActionFunctionArgs) {
* let user = await authenticator.authenticate("some", request);
* };
* @example
* async function action({ request }: ActionArgs) {
* async function action({ request }: ActionFunctionArgs) {
* return authenticator.authenticate("some", request, {
* successRedirect: "/private",
* failureRedirect: "/login",
Expand Down Expand Up @@ -165,7 +165,7 @@ export class Authenticator<User = unknown> {
* with the user object or null, you can use this to check if the user is
* logged-in or not without triggering the whole authentication flow.
* @example
* async function loader({ request }: LoaderArgs) {
* async function loader({ request }: LoaderFunctionArgs) {
* // if the user is not authenticated, redirect to login
* let user = await authenticator.isAuthenticated(request, {
* failureRedirect: "/login",
Expand All @@ -174,15 +174,15 @@ export class Authenticator<User = unknown> {
* return json(privateData);
* }
* @example
* async function loader({ request }: LoaderArgs) {
* async function loader({ request }: LoaderFunctionArgs) {
* // if the user is authenticated, redirect to /dashboard
* await authenticator.isAuthenticated(request, {
* successRedirect: "/dashboard"
* });
* return json(publicData);
* }
* @example
* async function loader({ request }: LoaderArgs) {
* async function loader({ request }: LoaderFunctionArgs) {
* // manually handle what happens if the user is or not authenticated
* let user = await authenticator.isAuthenticated(request);
* if (!user) return json(publicData);
Expand Down Expand Up @@ -261,7 +261,7 @@ export class Authenticator<User = unknown> {
/**
* Destroy the user session throw a redirect to another URL.
* @example
* async function action({ request }: ActionArgs) {
* async function action({ request }: ActionFunctionArgs) {
* await authenticator.logout(request, { redirectTo: "/login" });
* }
*/
Expand Down
Loading