[GH-ISSUE #3987] Type inconsistency: rememberMe is string in signIn but boolean in signUp #18419

Closed
opened 2026-04-15 16:52:38 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @LinusGobita on GitHub (Aug 13, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3987

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Bug Description

There's a type inconsistency in the rememberMe parameter between sign-up and sign-in:

  • signUp.email: rememberMe?: boolean (correct)
  • signIn.email: rememberMe?: string (should be boolean)

Current Behavior

TypeScript shows type error when passing boolean to signIn.email's rememberMe parameter.

Expected Behavior

Both signUp and signIn should accept rememberMe as boolean type.

Version

better-auth: 1.3.5

Workaround

// @ts-ignore
await authClient.signIn.email({
  email: "user@example.com",
  password: "password",
  rememberMe: true as any
})

The functionality works correctly at runtime with boolean values, it's just the TypeScript type definition that's incorrect.


### Current vs. Expected behavior

## Bug Description
There's a type inconsistency in the `rememberMe` parameter between sign-up and sign-in:

- `signUp.email`: `rememberMe?: boolean` ✅ (correct)
- `signIn.email`: `rememberMe?: string` ❌ (should be boolean)

## Current Behavior
TypeScript shows type error when passing boolean to signIn.email's rememberMe parameter.

## Expected Behavior
Both signUp and signIn should accept `rememberMe` as boolean type.

## Version
better-auth: 1.3.5

## Workaround
```typescript
// @ts-ignore
await authClient.signIn.email({
  email: "user@example.com",
  password: "password",
  rememberMe: true as any
})

The functionality works correctly at runtime with boolean values, it's just the TypeScript type definition that's incorrect.


### What version of Better Auth are you using?

"better-auth": "^1.3.4" "better-auth-cloudflare": "^0.2.2"

### System info

```bash
- better-auth: 1.3.5
- @better-auth/cli: 1.3.5
- better-auth-cloudflare: 0.2.3
- Node.js: v22.16.0
- TypeScript: 5.9.2
- OS: macOS Darwin 24.5.0
- Package Manager: npm

Which area(s) are affected? (Select all that apply)

Documentation, Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @LinusGobita on GitHub (Aug 13, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3987 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce ## Bug Description There's a type inconsistency in the `rememberMe` parameter between sign-up and sign-in: - `signUp.email`: `rememberMe?: boolean` ✅ (correct) - `signIn.email`: `rememberMe?: string` ❌ (should be boolean) ## Current Behavior TypeScript shows type error when passing boolean to signIn.email's rememberMe parameter. ## Expected Behavior Both signUp and signIn should accept `rememberMe` as boolean type. ## Version better-auth: 1.3.5 ## Workaround ```typescript // @ts-ignore await authClient.signIn.email({ email: "user@example.com", password: "password", rememberMe: true as any }) The functionality works correctly at runtime with boolean values, it's just the TypeScript type definition that's incorrect. ### Current vs. Expected behavior ## Bug Description There's a type inconsistency in the `rememberMe` parameter between sign-up and sign-in: - `signUp.email`: `rememberMe?: boolean` ✅ (correct) - `signIn.email`: `rememberMe?: string` ❌ (should be boolean) ## Current Behavior TypeScript shows type error when passing boolean to signIn.email's rememberMe parameter. ## Expected Behavior Both signUp and signIn should accept `rememberMe` as boolean type. ## Version better-auth: 1.3.5 ## Workaround ```typescript // @ts-ignore await authClient.signIn.email({ email: "user@example.com", password: "password", rememberMe: true as any }) The functionality works correctly at runtime with boolean values, it's just the TypeScript type definition that's incorrect. ### What version of Better Auth are you using? "better-auth": "^1.3.4" "better-auth-cloudflare": "^0.2.2" ### System info ```bash - better-auth: 1.3.5 - @better-auth/cli: 1.3.5 - better-auth-cloudflare: 0.2.3 - Node.js: v22.16.0 - TypeScript: 5.9.2 - OS: macOS Darwin 24.5.0 - Package Manager: npm ``` ### Which area(s) are affected? (Select all that apply) Documentation, Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-15 16:52:39 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 13, 2025):

Hi @LinusGobita! I'm Dosu and I’m helping the better-auth team.

Yes, this is suited for GitHub. The type inconsistency you found—rememberMe being a string in signIn.email but a boolean in signUp.email—is a valid bug in the TypeScript definitions. The documentation and intended usage show rememberMe should be a boolean for both methods, and runtime behavior works as expected with booleans, so this is purely a type definition issue that should be fixed for proper TypeScript support. There are no existing issues directly tracking this bug, and the root cause is likely a typo or oversight in the client type definitions (docs example).

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3186027212 --> @dosubot[bot] commented on GitHub (Aug 13, 2025): <!-- Greeting --> Hi @LinusGobita! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> Yes, this is suited for GitHub. The type inconsistency you found—`rememberMe` being a string in `signIn.email` but a boolean in `signUp.email`—is a valid bug in the TypeScript definitions. The documentation and intended usage show `rememberMe` should be a boolean for both methods, and runtime behavior works as expected with booleans, so this is purely a type definition issue that should be fixed for proper TypeScript support. There are no existing issues directly tracking this bug, and the root cause is likely a typo or oversight in the client type definitions ([docs example](https://better-auth.com/docs/basic-usage)). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/7702cfb8-cb4b-4405-ac7a-ee725434ce00?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7702cfb8-cb4b-4405-ac7a-ee725434ce00?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7702cfb8-cb4b-4405-ac7a-ee725434ce00?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7702cfb8-cb4b-4405-ac7a-ee725434ce00?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7702cfb8-cb4b-4405-ac7a-ee725434ce00?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7702cfb8-cb4b-4405-ac7a-ee725434ce00?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7702cfb8-cb4b-4405-ac7a-ee725434ce00?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/3987)
Author
Owner

@Kinfe123 commented on GitHub (Aug 13, 2025):

I dont think this is actually an issue. please can you provide a repro for this issue ?

<!-- gh-comment-id:3186094139 --> @Kinfe123 commented on GitHub (Aug 13, 2025): I dont think this is actually an issue. please can you provide a repro for this issue ?
Author
Owner

@1111mp commented on GitHub (Mar 9, 2026):

const onSubmit = async (value: z.infer<typeof UserCreateOneInput>) => {
    await authClient.signUp.email(
      {
        name: value.name,
        email: value.email,
        password: value.password,
        // @ts-expect-error rememberMe is supported at runtime but missing in types
        rememberMe: value.remember,
      },
      {
        onSuccess() {
          router.replace('/');
        },
        onError(ctx) {
          toast.error(ctx.error.message);
        },
      },
    );
  };
Image

Description

authClient.signUp.email accepts rememberMe at runtime but it's missing from TypeScript types (type error on known properties)

Expected Behavior

The type for signUp.email's options should include:

rememberMe?: boolean;

Just like signIn.email, so no type error occurs when passing a boolean value.

Current Behavior

rememberMe is treated as an unknown/extra property → TS error.
Must workaround with as any, @ts-expect-error, or avoid passing it entirely.

"better-auth": "^1.5.4"
<!-- gh-comment-id:4020930172 --> @1111mp commented on GitHub (Mar 9, 2026): ```ts const onSubmit = async (value: z.infer<typeof UserCreateOneInput>) => { await authClient.signUp.email( { name: value.name, email: value.email, password: value.password, // @ts-expect-error rememberMe is supported at runtime but missing in types rememberMe: value.remember, }, { onSuccess() { router.replace('/'); }, onError(ctx) { toast.error(ctx.error.message); }, }, ); }; ``` <img width="1142" height="397" alt="Image" src="https://github.com/user-attachments/assets/ed457450-a56a-4d1a-a383-55619a2946b0" /> ## Description `authClient.signUp.email` accepts rememberMe at runtime but it's missing from TypeScript types (type error on known properties) ## Expected Behavior The type for signUp.email's options should include: ```ts rememberMe?: boolean; ``` Just like `signIn.email`, so no type error occurs when passing a boolean value. ## Current Behavior `rememberMe` is treated as an unknown/extra property → TS error. Must workaround with `as any`, `@ts-expect-error`, or avoid passing it entirely. ```txt "better-auth": "^1.5.4" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18419