Repository navigation
Commit b2bbcd6
committed
refactor(plugin-auth): move the createAuthInstance body into auth-manager-auth-instance.ts
The body of AuthManager.createAuthInstance() moves unedited into the
module function createAuthInstance, re-indented one level: the deferred
better-auth imports, the plugin list and password hasher, the whole
config literal (including the hooks.before and hooks.after arrows that
cuts 12 and 13 left in place), the betterAuth() call and the wait on
auth.$context. The method keeps its place, docblock, modifiers and
return type; it now builds one host of the forty-seven AuthManager
members the body reads (forty-five methods as late-bound closures,
config and idpLocale as getters) and returns
createAuthInstance.call(host). The async moved from the method to the
function.
readDisableSignUpEnv, the one top-level helper the body reads, is
exported in place and imported by value; src/index.ts names its
auth-manager.ts exports one by one, so nothing new is published. Ten
imported values leave auth-manager.ts with the body, and the cut 12 and
cut 13 hook imports are replaced by the new module's.
One reader outside the move follows it: the population comments in
auth-email-locale.test.ts name the new module among the files the five
sendTemplate sites live in.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LSXBc2GCBwiAL7vV4kWkyr1 parent 45f9962 commit b2bbcd6
3 files changed
Lines changed: 926 additions & 749 deletions
File tree
- packages/plugins/plugin-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
862 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
| |||
1122 | 1123 | | |
1123 | 1124 | | |
1124 | 1125 | | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1128 | 1129 | | |
1129 | 1130 | | |
1130 | 1131 | | |
| |||
0 commit comments