[GH-ISSUE #6315] No auth context found #19112

Closed
opened 2026-04-15 17:53:59 -05:00 by GiteaMirror · 18 comments
Owner

Originally created by @jerebtw on GitHub (Nov 25, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6315

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

export const auth = betterAuth<BetterAuthOptions>({
  experimental: {
    joins: true,
  },
  database: drizzleAdapter(db, {
    provider: "pg",
    schema: schema,
  }),
  trustedOrigins: [process.env.CORS_ORIGIN || ""],
  emailAndPassword: {
    enabled: true,
  },
  advanced: {
    defaultCookieAttributes: {
      sameSite: "none",
      secure: true,
      httpOnly: true,
    },
    database: {
      generateId: "uuid",
    },
  },
  plugins: [
    organization(),
    passkey(),

  ],
});

const ctx = await auth.$context;

async function createUser(email: string, name: string, password: string) {
  const user = await ctx.internalAdapter.createUser({
    email,
    name,
    emailVerified: true,
  });

  await ctx.internalAdapter.createAccount({
    accountId: user.id,
    providerId: "credential",
    userId: user.id,
    password: await ctx.password.hash(password),
  });

  return user.id;
}

console.log("Creating users...");
const adminUserId = await createUser(
  "email@gmail.com",
  "name",
  "password",
);

Current vs. Expected behavior

It should work like with v1.3.x

Now i get with v1.4.2

14 | async function getCurrentAuthContextAsyncLocalStorage() {
15 |    return ensureAsyncStorage$2();
16 | }
17 | async function getCurrentAuthContext() {
18 |    const context = (await ensureAsyncStorage$2()).getStore();
19 |    if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");
                              ^
error: No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.
      at getCurrentAuthContext (/Users/app/node_modules/.bun/@better-auth+core@1.4.2+c297deb563943dfa/node_modules/@better-auth/co
re/dist/context-DgQ9XGBl.mjs:19:26)
      at async createWithHooks (/Users/app/node_modules/.bun/better-auth@1.4.2/node_modules/better-auth/dist/get-migration-6ewabxR
C.mjs:84:25)
      at async <anonymous> (/Users/app/node_modules/.bun/better-auth@1.4.2/node_modules/better-auth/dist/get-migration-6ewabxRC.mj
s:269:17)
      at async createUser (/Users/app/apps/server/seed.ts:8:42)

What version of Better Auth are you using?

1.4.2

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041",
    "release": "25.1.0",
    "cpuCount": 12,
    "cpuModel": "Apple M4 Pro",
    "totalMemory": "24.00 GB",
    "freeMemory": "0.19 GB"
  },
  "node": {
    "version": "v25.2.1",
    "env": "development"
  },
  "packageManager": {
    "name": "bun",
    "version": "1.3.3"
  },
  "frameworks": null,
  "databases": null,
  "betterAuth": {
    "version": "Unknown",
    "config": null
  }
}

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

Backend

Auth config (if applicable)

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

Additional context

No response

Originally created by @jerebtw on GitHub (Nov 25, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6315 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce ```ts export const auth = betterAuth<BetterAuthOptions>({ experimental: { joins: true, }, database: drizzleAdapter(db, { provider: "pg", schema: schema, }), trustedOrigins: [process.env.CORS_ORIGIN || ""], emailAndPassword: { enabled: true, }, advanced: { defaultCookieAttributes: { sameSite: "none", secure: true, httpOnly: true, }, database: { generateId: "uuid", }, }, plugins: [ organization(), passkey(), ], }); const ctx = await auth.$context; async function createUser(email: string, name: string, password: string) { const user = await ctx.internalAdapter.createUser({ email, name, emailVerified: true, }); await ctx.internalAdapter.createAccount({ accountId: user.id, providerId: "credential", userId: user.id, password: await ctx.password.hash(password), }); return user.id; } console.log("Creating users..."); const adminUserId = await createUser( "email@gmail.com", "name", "password", ); ``` ### Current vs. Expected behavior It should work like with v1.3.x Now i get with v1.4.2 ```bash 14 | async function getCurrentAuthContextAsyncLocalStorage() { 15 | return ensureAsyncStorage$2(); 16 | } 17 | async function getCurrentAuthContext() { 18 | const context = (await ensureAsyncStorage$2()).getStore(); 19 | if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback."); ^ error: No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback. at getCurrentAuthContext (/Users/app/node_modules/.bun/@better-auth+core@1.4.2+c297deb563943dfa/node_modules/@better-auth/co re/dist/context-DgQ9XGBl.mjs:19:26) at async createWithHooks (/Users/app/node_modules/.bun/better-auth@1.4.2/node_modules/better-auth/dist/get-migration-6ewabxR C.mjs:84:25) at async <anonymous> (/Users/app/node_modules/.bun/better-auth@1.4.2/node_modules/better-auth/dist/get-migration-6ewabxRC.mj s:269:17) at async createUser (/Users/app/apps/server/seed.ts:8:42) ``` ### What version of Better Auth are you using? 1.4.2 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041", "release": "25.1.0", "cpuCount": 12, "cpuModel": "Apple M4 Pro", "totalMemory": "24.00 GB", "freeMemory": "0.19 GB" }, "node": { "version": "v25.2.1", "env": "development" }, "packageManager": { "name": "bun", "version": "1.3.3" }, "frameworks": null, "databases": null, "betterAuth": { "version": "Unknown", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) 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 17:54:00 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 25, 2025):

(tag @better-auth-agent if you would like an answer from the Agent)

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3577539717 --> @better-auth-agent[bot] commented on GitHub (Nov 25, 2025): (tag @better-auth-agent if you would like an answer from the Agent) <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@dosubot[bot] commented on GitHub (Nov 25, 2025):

In Better Auth v1.4.2, context management was refactored: any call to internal adapter methods like createUser now requires an active auth context, which is set up automatically in endpoint/request handlers but not in standalone scripts. This is why you see the "No auth context found" error in your seed script.

To fix this, wrap your logic in runWithEndpointContext and pass a minimal context object. Here’s how you can adapt your seed script:

import { runWithEndpointContext } from "@better-auth/core/context";

const ctx = await auth.$context;

// Minimal context for seeding (add more fields if your plugins need them)
const endpointContext = {
  ...ctx,
  // Optionally: headers, request, etc. if needed by plugins/adapters
};

await runWithEndpointContext(endpointContext, async () => {
  console.log("Creating users...");
  const adminUserId = await createUser(
    "email@gmail.com",
    "name",
    "password",
  );
  // ...more seed logic
});

This ensures AsyncLocalStorage is populated and all internal adapter calls work as expected in v1.4.2. For more details, see the migration notes and refactor PRs:
Refactor introducing runWithEndpointContext
Context API moved to core
AsyncLocalStorage context implementation

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

<!-- gh-comment-id:3577553522 --> @dosubot[bot] commented on GitHub (Nov 25, 2025): <!-- Answer --> In Better Auth v1.4.2, context management was refactored: any call to internal adapter methods like `createUser` now requires an active auth context, which is set up automatically in endpoint/request handlers but not in standalone scripts. This is why you see the "No auth context found" error in your seed script. To fix this, wrap your logic in `runWithEndpointContext` and pass a minimal context object. Here’s how you can adapt your seed script: ```ts import { runWithEndpointContext } from "@better-auth/core/context"; const ctx = await auth.$context; // Minimal context for seeding (add more fields if your plugins need them) const endpointContext = { ...ctx, // Optionally: headers, request, etc. if needed by plugins/adapters }; await runWithEndpointContext(endpointContext, async () => { console.log("Creating users..."); const adminUserId = await createUser( "email@gmail.com", "name", "password", ); // ...more seed logic }); ``` This ensures AsyncLocalStorage is populated and all internal adapter calls work as expected in v1.4.2. For more details, see the migration notes and refactor PRs: [Refactor introducing runWithEndpointContext](https://github.com/better-auth/better-auth/pull/5290) [Context API moved to core](https://github.com/better-auth/better-auth/pull/5285) [AsyncLocalStorage context implementation](https://github.com/better-auth/better-auth/blob/a2e6a8a751d35b62602db7dcc07acffdbae366c7/packages/core/src/context/endpoint-context.ts#L12-L49) <!-- 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/1a4808c2-943c-4f92-b5bf-1dac64804082?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1a4808c2-943c-4f92-b5bf-1dac64804082?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1a4808c2-943c-4f92-b5bf-1dac64804082?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1a4808c2-943c-4f92-b5bf-1dac64804082?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1a4808c2-943c-4f92-b5bf-1dac64804082?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1a4808c2-943c-4f92-b5bf-1dac64804082?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1a4808c2-943c-4f92-b5bf-1dac64804082?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=In%20Better%20Auth%20v1.4.2%2C%20context%20management%20was%20refactored%3A%20any%20call%20to%20internal%20adapter%20methods%20like%20%60createUser%60%20now%20requires%20an%20active%20auth%20context%2C%20which%20is%20set%20up%20automatically%20in%20endpoint/request%20handlers%20but%20not%20in%20standalone%20scripts.%20This%20is%20why%20you%20see%20the%20%22No%20auth%20context%20found%22%20error%20in%20your%20seed%20script.%0A%0ATo%20fix%20this%2C%20wrap%20your%20logic%20in%20%60runWithEndpointContext%60%20and%20pass%20a%20minimal%20context%20object.%20Here%E2%80%99s%20how%20you%20can%20adapt%20your%20seed%20script%3A%0A%0A%60%60%60ts%0Aimport%20%7B%20runWithEndpointContext%20%7D%20from%20%22%40better-auth/core/context%22%3B%0A%0Aconst%20ctx%20%3D%20await%20auth.%24context%3B%0A%0A//%20Minimal%20context%20for%20seeding%20%28add%20more%20fields%20if%20your%20plugins%20need%20them%29%0Aconst%20endpointContext%20%3D%20%7B%0A%20%20...ctx%2C%0A%20%20//%20Optionally%3A%20headers%2C%20request%2C%20etc.%20if%20needed%20by%20plugins/adapters%0A%7D%3B%0A%0Aawait%20runWithEndpointContext%28endpointContext%2C%20async%20%28%29%20%3D%3E%20%7B%0A%20%20console.log%28%22Creating%20users...%22%29%3B%0A%20%20const%20adminUserId%20%3D%20await%20createUser%28%0A%20%20%20%20%22email%40gmail.com%22%2C%0A%20%20%20%20%22name%22%2C%0A%20%20%20%20%22password%22%2C%0A%20%20%29%3B%0A%20%20//%20...more%20seed%20logic%0A%7D%29%3B%0A%60%60%60%0A%0AThis%20ensures%20AsyncLocalStorage%20is%20populated%20and%20all%20internal%20adapter%20calls%20work%20as%20expected%20in%20v1.4.2.%20For%20more%20details%2C%20see%20the%20migration%20notes%20and%20refactor%20PRs%3A%20%20%0A%5BRefactor%20introducing%20runWithEndpointContext%5D%28https%3A//github.com/better-auth/better-auth/pull/5290%29%20%20%0A%5BContext%20API%20moved%20to%20core%5D%28https%3A//github.com/better-auth/better-auth/pull/5285%29%20%20%0A%5BAsyncLocalStorage%20context%20implementation%5D%28https%3A//github.com/better-auth/better-auth/blob/a2e6a8a751d35b62602db7dcc07acffdbae366c7/packages/core/src/context/endpoint-context.ts%23L12-L49%29)&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/6315)
Author
Owner

@timbit123 commented on GitHub (Nov 25, 2025):

I have the same issue,
running multiple instance of better-auth simultaneously
I have a function getAuth that I can pass the request headers to pull the right auth settings

  const auth = getAuth(await headers());
  const authContext = await auth.$context;
  const endpointCtx = { context: authContext } as GenericEndpointContext;

  const createdUser = await runWithEndpointContext(endpointCtx, () =>
    authContext.internalAdapter.createUser({
      name: "test",
      email: "test@test.com",
      role: "user"
    })
  );

and I still get
Error: No auth context found. Please make sure you are calling this function within a runWithEndpointContext callback.
node v24

I can do

    const { context } = await getCurrentAuthContext();

inside my runWithEndpointContext and it will return the context, but when createUser call createWithHooks, the const context = await getCurrentAuthContext(); there doesn't return anything even if I try

  const createdUser = await runWithEndpointContext(endpointCtx, async () => {
    const { context } = await getCurrentAuthContext();
    return await context.internalAdapter.createUser({
      name: "test",
      email: "test@test.com",
      role: "user"
    });
  });
<!-- gh-comment-id:3577713116 --> @timbit123 commented on GitHub (Nov 25, 2025): I have the same issue, running multiple instance of better-auth simultaneously I have a function getAuth that I can pass the request headers to pull the right auth settings ```typescript const auth = getAuth(await headers()); const authContext = await auth.$context; const endpointCtx = { context: authContext } as GenericEndpointContext; const createdUser = await runWithEndpointContext(endpointCtx, () => authContext.internalAdapter.createUser({ name: "test", email: "test@test.com", role: "user" }) ); ``` and I still get Error: No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback. node v24 I can do ```typescript const { context } = await getCurrentAuthContext(); ``` inside my runWithEndpointContext and it will return the context, but when createUser call createWithHooks, the const context = await getCurrentAuthContext(); there doesn't return anything even if I try ```typescript const createdUser = await runWithEndpointContext(endpointCtx, async () => { const { context } = await getCurrentAuthContext(); return await context.internalAdapter.createUser({ name: "test", email: "test@test.com", role: "user" }); }); ```
Author
Owner

@timbit123 commented on GitHub (Nov 26, 2025):

Is it possible to get a release with this patch. the 1.4.3 doesn't have it.
it could be a beta release if possible

<!-- gh-comment-id:3582333272 --> @timbit123 commented on GitHub (Nov 26, 2025): Is it possible to get a release with this patch. the 1.4.3 doesn't have it. it could be a beta release if possible
Author
Owner

@timbit123 commented on GitHub (Nov 26, 2025):

I just tested
https://github.com/better-auth/better-auth/releases/tag/v1.4.4-beta.1
and this issue is still there for me
this ticket should be reopened

<!-- gh-comment-id:3583277968 --> @timbit123 commented on GitHub (Nov 26, 2025): I just tested https://github.com/better-auth/better-auth/releases/tag/v1.4.4-beta.1 and this issue is still there for me this ticket should be reopened
Author
Owner

@himself65 commented on GitHub (Nov 26, 2025):

I just tested https://github.com/better-auth/better-auth/releases/tag/v1.4.4-beta.1 and this issue is still there for me this ticket should be reopened

Could you provide repro code?

<!-- gh-comment-id:3583312100 --> @himself65 commented on GitHub (Nov 26, 2025): > I just tested https://github.com/better-auth/better-auth/releases/tag/v1.4.4-beta.1 and this issue is still there for me this ticket should be reopened Could you provide repro code?
Author
Owner

@timbit123 commented on GitHub (Nov 26, 2025):

I just tested https://github.com/better-auth/better-auth/releases/tag/v1.4.4-beta.1 and this issue is still there for me this ticket should be reopened

Could you provide repro code?

I will try to provide a snippet or tests

<!-- gh-comment-id:3583365216 --> @timbit123 commented on GitHub (Nov 26, 2025): > > I just tested https://github.com/better-auth/better-auth/releases/tag/v1.4.4-beta.1 and this issue is still there for me this ticket should be reopened > > Could you provide repro code? I will try to provide a snippet or tests
Author
Owner

@blackfyre commented on GitHub (Nov 27, 2025):

Soo... We're also facing this issue, and yes, we're seeding some data.

const authContext = await auth.$context;
const pwHash = await authContext.password.hash(user.password);
<!-- gh-comment-id:3587186234 --> @blackfyre commented on GitHub (Nov 27, 2025): Soo... We're also facing this issue, and yes, we're seeding some data. ```typescript const authContext = await auth.$context; const pwHash = await authContext.password.hash(user.password); ```
Author
Owner

@timbit123 commented on GitHub (Nov 27, 2025):

I understand the idea behind AsyncLocalStorage it is the same idea of react and context provider. But the implementation could probably be improved.
Why when getting the context from auth.$context, it cannot handle itself for any function and hooks that are implemented inside the context itself

when calling for example
await context.internalAdapter.createUser()
internalAdapter is already inside the context, I shouldn't have to wrap the context with runWithEndpointContext and I think runWithEndpointContext should be inside the root element of the context.

it is working for some reason with 1.4.3. don't know if I had some cache issues even if I forced the version before. sorry for that

<!-- gh-comment-id:3587242944 --> @timbit123 commented on GitHub (Nov 27, 2025): I understand the idea behind AsyncLocalStorage it is the same idea of react and context provider. But the implementation could probably be improved. Why when getting the context from auth.$context, it cannot handle itself for any function and hooks that are implemented inside the context itself when calling for example await context.internalAdapter.createUser() internalAdapter is already inside the context, I shouldn't have to wrap the context with runWithEndpointContext and I think runWithEndpointContext should be inside the root element of the context. it is working for some reason with 1.4.3. don't know if I had some cache issues even if I forced the version before. sorry for that
Author
Owner

@blackfyre commented on GitHub (Nov 28, 2025):

We've solved our issue by moving to the admin plugin's server side calls. I realize that it's not a silver bullet, but it solved our issue.

<!-- gh-comment-id:3588368627 --> @blackfyre commented on GitHub (Nov 28, 2025): We've solved our issue by moving to the admin plugin's server side calls. I realize that it's not a silver bullet, but it solved our issue.
Author
Owner

@andrebrito16 commented on GitHub (Dec 3, 2025):

Still having same issue when using auth.$context

<!-- gh-comment-id:3608448787 --> @andrebrito16 commented on GitHub (Dec 3, 2025): Still having same issue when using auth.$context
Author
Owner

@himself65 commented on GitHub (Dec 3, 2025):

It's not recommended to use auth.$context outside of endpoint scope. And we will provider an adapter API for the case

<!-- gh-comment-id:3608483522 --> @himself65 commented on GitHub (Dec 3, 2025): It's not recommended to use `auth.$context` outside of endpoint scope. And we will provider an adapter API for the case
Author
Owner

@andrebrito16 commented on GitHub (Dec 3, 2025):

@himself65 great, can you give-me an example how can I make const newAccount = await ctx.internalAdapter.createAccount({}) works in this case?

<!-- gh-comment-id:3608514291 --> @andrebrito16 commented on GitHub (Dec 3, 2025): @himself65 great, can you give-me an example how can I make `const newAccount = await ctx.internalAdapter.createAccount({})` works in this case?
Author
Owner

@MrLightful commented on GitHub (Dec 8, 2025):

It's not recommended to use auth.$context outside of endpoint scope. And we will provider an adapter API for the case

What would be the preferred way then?

Use-case: creating default admin users on server launch. So there is not API/endpoint context. It just runs in instrumentation. So basically seeding data.

<!-- gh-comment-id:3626759601 --> @MrLightful commented on GitHub (Dec 8, 2025): > It's not recommended to use `auth.$context` outside of endpoint scope. And we will provider an adapter API for the case What would be the preferred way then? Use-case: creating default admin users on server launch. So there is not API/endpoint context. It just runs in instrumentation. So basically seeding data.
Author
Owner

@blackfyre commented on GitHub (Dec 9, 2025):

It's not recommended to use auth.$context outside of endpoint scope. And we will provider an adapter API for the case

What would be the preferred way then?

Use-case: creating default admin users on server launch. So there is not API/endpoint context. It just runs in instrumentation. So basically seeding data.

Did you try to pull in the admin plugin? It exposes an internal api that you can use to create users with any role: https://www.better-auth.com/docs/plugins/admin#create-user

<!-- gh-comment-id:3630781685 --> @blackfyre commented on GitHub (Dec 9, 2025): > > It's not recommended to use `auth.$context` outside of endpoint scope. And we will provider an adapter API for the case > > What would be the preferred way then? > > Use-case: creating default admin users on server launch. So there is not API/endpoint context. It just runs in instrumentation. So basically seeding data. Did you try to pull in the admin plugin? It exposes an internal api that you can use to create users with any role: https://www.better-auth.com/docs/plugins/admin#create-user
Author
Owner

@himself65 commented on GitHub (Dec 9, 2025):

Revert my words. I have fixed the usage of calling internalAdapter outside of the context. It will be landed in the next version.

Related PR: https://github.com/better-auth/better-auth/pull/6617

<!-- gh-comment-id:3630803035 --> @himself65 commented on GitHub (Dec 9, 2025): Revert my words. I have fixed the usage of calling internalAdapter outside of the context. It will be landed in the next version. Related PR: https://github.com/better-auth/better-auth/pull/6617
Author
Owner

@MrLightful commented on GitHub (Dec 9, 2025):

Did you try to pull in the admin plugin?

Yeah, but am a bit repelled of using it, because the password is being a required field. My app, however, only allows SSO. So for security reasons, I don't want to set any passwords as workaround. Even though I never enabled email/password for auth, still feels wrong to do so.

<!-- gh-comment-id:3630833298 --> @MrLightful commented on GitHub (Dec 9, 2025): > Did you try to pull in the admin plugin? Yeah, but am a bit repelled of using it, because the password is being a required field. My app, however, only allows SSO. So for security reasons, I don't want to set any passwords as workaround. Even though I never enabled email/password for auth, still feels wrong to do so.
Author
Owner

@blackfyre commented on GitHub (Dec 9, 2025):

@MrLightful
a 200+ character random string works as well... Also, you could just fill the necessary tables without going through BetterAuth...
The only reason I'm not doing that is that I need the pw hashing function to work.

<!-- gh-comment-id:3630877900 --> @blackfyre commented on GitHub (Dec 9, 2025): @MrLightful a 200+ character random string works as well... Also, you could just fill the necessary tables without going through BetterAuth... The only reason I'm not doing that is that I need the pw hashing function to work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19112