remix-auth-form
remix-auth-form copied to clipboard
The FormStrategy constructor doesn't accept any arguments.
It looks like the constructor is broken in the v1.5.0
version.
Expected 0 arguments, but got 1.ts(2554)
The constructor seems to be missing in index..d.ts
import { AppLoadContext, SessionStorage } from "@remix-run/server-runtime";
import { AuthenticateOptions, Strategy } from "remix-auth";
export interface FormStrategyVerifyParams {
/**
* A FormData object with the content of the form used to trigger the
* authentication.
*
* Here you can read any input value using the FormData API.
*/
form: FormData;
/**
* An object of arbitrary for route loaders and actions provided by the
* server's `getLoadContext()` function.
*/
context?: AppLoadContext;
/**
* The request that triggered the authentication.
*/
request: Request;
}
export declare class FormStrategy<User> extends Strategy<User, FormStrategyVerifyParams> {
name: string;
authenticate(request: Request, sessionStorage: SessionStorage, options: AuthenticateOptions): Promise<User>;
private readFormData;
}
The constructor is not needed because FormStrategy uses the same one used by Strategy class from Remix Auth, that's why it's not in the type.
The tests of the packages shows TS doesn't complain against the constructor argument, even when importing from the built files instead of the source files.
If you can, try to create a reproduction repo with this TS issue.