Skip to content

Commit

Permalink
Use LoaderFunctionArgs and ActionFunctionArgs instead in jsdoc (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
fzn0x committed May 26, 2024
1 parent 610b485 commit b22ea79
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit b22ea79

Please sign in to comment.