MCPcopy Index your code

hub / github.com/better-auth-rs/better-auth-rs / functions

Functions2,120 in github.com/better-auth-rs/better-auth-rs

↓ 570 callersMethodclone
(&self)
crates/core/src/plugin.rs:269
↓ 141 callersMethodid
(&self)
crates/core/src/types_impls.rs:39
↓ 139 callersMethodas_str
Return the SCREAMING_SNAKE_CASE string for this error code. Used by `handle_verify` to produce the structured JSON error response.
crates/api/src/plugins/api_key/mod.rs:81
↓ 124 callersFunctionsend_request
( auth: &BetterAuth<MemoryDatabaseAdapter>, req: AuthRequest, )
tests/compat/helpers.rs:148
↓ 119 callersMethodhandle_request
Handle an authentication request. Errors from plugins and core handlers are automatically converted into standardized JSON responses via [`AuthError:
src/core/auth.rs:243
↓ 119 callersMethodroute
Add a single route entry.
crates/core/src/openapi.rs:66
↓ 97 callersMethodwith_email
(mut self, email: impl Into<String>)
crates/core/src/types.rs:403
↓ 93 callersMethodwith_name
(mut self, name: impl Into<String>)
crates/core/src/types.rs:408
↓ 80 callersMethodto_context
Create an `AuthContext` for use with existing plugin handler methods.
crates/core/src/plugin.rs:291
↓ 79 callersMethodplugin
Add a plugin to the authentication system.
src/core/auth.rs:126
↓ 74 callersMethodget
(path: impl Into<String>, operation_id: impl Into<String>)
crates/core/src/plugin.rs:190
↓ 69 callersMethodon_request
( &self, req: &AuthRequest, ctx: &AuthContext<DB>, )
crates/api/src/plugins/oauth/mod.rs:63
↓ 63 callersFunctioncreate_auth_request
( method: HttpMethod, path: &str, token: Option<&str>, body: Option<serde_json::Value>, qu
crates/api/src/plugins/api_key/tests.rs:69
↓ 63 callersMethodheader
(&self, name: &str)
crates/core/src/types.rs:485
↓ 61 callersMethodmethod
(&self)
crates/core/src/types.rs:477
↓ 58 callersFunctionvalidate_request_body
Validate a request body, returning a parsed + validated value or an error response.
crates/core/src/error.rs:271
↓ 57 callersMethodcreate_user
(&self, mut user: CreateUser)
crates/core/src/hooks.rs:210
↓ 55 callersFunctionpost_json_with_auth
(path: &str, body: Value, token: &str)
tests/compat/helpers.rs:114
↓ 51 callersMethodtext
(status: u16, text: impl Into<String>)
crates/core/src/types.rs:536
↓ 48 callersMethodget_user_by_id
(&self, id: &str)
crates/core/src/hooks.rs:220
↓ 47 callersFunctioncreate_test_auth
()
tests/compat/helpers.rs:47
↓ 47 callersFunctionmake_request
( method: HttpMethod, path: &str, token: &str, body: Option<serde_json::Value>, )
crates/api/src/plugins/admin/tests.rs:47
↓ 46 callersMethoddatabase
Set the database adapter, returning a [`TypedAuthBuilder`].
src/core/auth.rs:79
↓ 45 callersFunctioncreate_test_context_with_user
()
crates/api/src/plugins/api_key/tests.rs:8
↓ 44 callersMethodcreate_session
Create a new session for a user
crates/core/src/session.rs:31
↓ 42 callersFunctioncreate_admin_context
()
crates/api/src/plugins/admin/tests.rs:11
↓ 41 callersFunctioncreate_test_context_with_user
()
crates/api/src/plugins/password_management/tests.rs:9
↓ 41 callersMethodget
Build a GET request (with `origin` header).
tests/compat/helpers.rs:285
↓ 41 callersFunctionsignup_user
( auth: &BetterAuth<MemoryDatabaseAdapter>, email: &str, password: &str, name: &str, )
tests/compat/helpers.rs:162
↓ 39 callersMethodcreate_verification
( &self, mut verification: CreateVerification, )
crates/core/src/hooks.rs:367
↓ 38 callersFunctioncreate_test_auth_memory
Helper to create test BetterAuth instance with memory database
tests/integration_tests.rs:11
↓ 37 callersMethodbuild
Build the final OpenAPI spec.
crates/core/src/openapi.rs:125
↓ 34 callersFunctioncreate_auth_request_no_query
( method: HttpMethod, path: &str, token: Option<&str>, body: Option<Vec<u8>>,
crates/api/src/plugins/mod.rs:118
↓ 34 callersMethodget_session
Get session by token
crates/core/src/session.rs:53
↓ 32 callersMethodemail
(&self)
crates/core/src/types_impls.rs:42
↓ 32 callersMethodpath
(&self)
crates/core/src/types.rs:481
↓ 31 callersMethodbuild
Build the BetterAuth instance.
src/core/auth.rs:174
↓ 31 callersMethodvalidate_endpoint
Validate a single endpoint response against the spec.
tests/compat/validator.rs:65
↓ 30 callersFunctioncreate_test_auth
Helper to create test BetterAuth instance with all plugins
tests/axum_integration_tests.rs:19
↓ 30 callersFunctioncreate_test_router
Helper to create the complete Axum router (mimics the example server)
tests/axum_integration_tests.rs:37
↓ 30 callersMethodrequire_session
Extract a session token from the request, validate the session, and return the authenticated `(User, Session)` pair. This centralises the pattern pre
crates/core/src/plugin.rs:243
↓ 30 callersMethoduser_id
(&self)
crates/core/src/types_impls.rs:108
↓ 29 callersFunctioncreate_test_auth
()
src/tests/response_shape_tests.rs:25
↓ 29 callersFunctionjson_body
(resp: &AuthResponse)
crates/api/src/plugins/admin/tests.rs:66
↓ 29 callersMethodtoken
(&self)
crates/core/src/types_impls.rs:93
↓ 28 callersMethodvalue
(&self)
crates/core/src/types_impls.rs:240
↓ 27 callersFunctioncreate_test_context
()
crates/api/src/plugins/mod.rs:38
↓ 27 callersMethodget
(path: impl Into<String>, handler: impl Into<String>)
crates/better-auth-api/src/core/plugin.rs:114
↓ 27 callersMethodget_user_by_email
(&self, email: &str)
crates/core/src/hooks.rs:224
↓ 26 callersFunctionpost_json
(path: &str, body: Value)
tests/compat/helpers.rs:76
↓ 26 callersMethodupdate_user
(&self, id: &str, mut update: UpdateUser)
crates/core/src/hooks.rs:232
↓ 25 callersFunctionget_with_auth
(path: &str, token: &str)
tests/compat/helpers.rs:93
↓ 25 callersMethodinto_response
Convert this error into a standardized [`AuthResponse`] matching the better-auth OpenAPI spec: `{ "message": "..." }`. Internal errors (500) use a ge
crates/core/src/error.rs:109
↓ 25 callersFunctionsignup_user
Sign up a user and return (token, response_json).
src/tests/response_shape_tests.rs:66
↓ 24 callersMethodget
(&self, key: &str)
crates/core/src/adapters/cache.rs:79
↓ 24 callersFunctionoptionalPlugin
(name, ...factoryArgs)
scripts/generate-openapi-matrix.mjs:65
↓ 24 callersFunctionpushIf
(target, plugin)
scripts/generate-openapi-matrix.mjs:74
↓ 23 callersFunctioncreate_test_user_and_session
Helper to create user and get session token
tests/integration_tests.rs:16
↓ 23 callersMethoddefault
()
crates/core/src/types.rs:440
↓ 23 callersMethodhandle_verify
( &self, req: &AuthRequest, ctx: &AuthContext<DB>, )
crates/api/src/plugins/api_key/mod.rs:549
↓ 23 callersMethodrole
(&self)
crates/core/src/types_impls.rs:69
↓ 23 callersMethodsession_manager
Create a `SessionManager` from this context's config and database.
crates/core/src/plugin.rs:234
↓ 22 callersFunctionconfig_with
(trusted: Vec<&str>)
crates/core/src/config.rs:831
↓ 22 callersMethoddelete_verification
(&self, id: &str)
crates/core/src/hooks.rs:410
↓ 22 callersMethodtable
()
crates/core/src/entity.rs:228
↓ 21 callersMethodbase_url
Set the base URL (e.g. `"https://myapp.com"`).
crates/core/src/config.rs:457
↓ 21 callersMethodwith_email_verified
(mut self, verified: bool)
crates/core/src/types.rs:413
↓ 20 callersFunctioncreate_auth_json_request_no_query
( method: HttpMethod, path: &str, token: Option<&str>, body: Option<serde_json
crates/api/src/plugins/mod.rs:127
↓ 20 callersMethodorganization_id
(&self)
crates/core/src/types_impls.rs:192
↓ 20 callersFunctionpost_json
(path: &str, body: serde_json::Value)
src/tests/response_shape_tests.rs:39
↓ 20 callersMethodwith_header
(mut self, name: impl Into<String>, value: impl Into<String>)
crates/core/src/types.rs:548
↓ 19 callersFunctioncreate_key_and_get_raw
Helper: create a key and return (id, raw_key)
crates/api/src/plugins/api_key/tests.rs:113
↓ 19 callersMethodenable_signup
(mut self, enable: bool)
crates/api/src/plugins/email_password.rs:149
↓ 19 callersFunctionjson_body
(response: &AuthResponse)
crates/api/src/plugins/api_key/tests.rs:90
↓ 19 callersFunctionpost_json_with_auth
(path: &str, body: serde_json::Value, token: &str)
src/tests/response_shape_tests.rs:58
↓ 19 callersFunctionrequire_session
Helper function to require authenticated session
crates/api/src/plugins/organization/handlers/mod.rs:20
↓ 19 callersMethodstatus
(&self)
crates/core/src/types_impls.rs:219
↓ 17 callersMethodcreate_account
(&self, mut account: CreateAccount)
crates/core/src/hooks.rs:315
↓ 17 callersFunctioncreate_auth_request
(method: HttpMethod, path: &str, token: Option<&str>, body: Option<Vec<u8>>)
crates/better-auth-api/src/plugins/password_management.rs:621
↓ 17 callersMethodexpires_at
(&self)
crates/core/src/types_impls.rs:90
↓ 17 callersMethodget_user_accounts
(&self, user_id: &str)
crates/core/src/hooks.rs:333
↓ 17 callersFunctionsend
Helper: send a request through the auth handler
examples/basic_usage.rs:269
↓ 16 callersFunctioncreate_session_cookie
Build a `Set-Cookie` header value for a session token using the `cookie` crate for correct formatting and escaping.
crates/core/src/utils/cookie_utils.rs:12
↓ 16 callersFunctioncreate_test_context_with_user
()
crates/better-auth-api/src/plugins/password_management.rs:579
↓ 16 callersFunctioncreate_test_user
Helper to create a user and return user data + session token
tests/axum_integration_tests.rs:62
↓ 16 callersMethodget_member
( &self, organization_id: &str, user_id: &str, )
crates/core/src/hooks.rs:466
↓ 16 callersMethodpassword_min_length
Set the minimum password length.
crates/core/src/config.rs:531
↓ 15 callersMethodas_str
(self)
scripts/sync_better_auth_openapi.rs:62
↓ 13 callersMethodbody_as_json
(&self)
crates/core/src/types.rs:506
↓ 13 callersFunctioncreate_full_auth
Create a test auth instance with all currently implemented plugins.
tests/compatibility_tests.rs:51
↓ 13 callersMethodget_user_sessions
(&self, user_id: &str)
crates/core/src/hooks.rs:270
↓ 13 callersMethodparse
(s: &str)
crates/api/src/plugins/organization/rbac.rs:12
↓ 13 callersMethodwith_hook
(mut self, hook: Arc<dyn DatabaseHooks<DB>>)
crates/core/src/hooks.rs:148
↓ 12 callersFunctioncreate_auth_with_apikey
Helper: create auth with ApiKeyPlugin and return auth + session token
tests/integration_tests.rs:1671
↓ 12 callersMethoddelete_session
Delete a session
crates/core/src/session.rs:136
↓ 12 callersMethoddelete_user_sessions
Delete all sessions for a user
crates/core/src/session.rs:142
↓ 12 callersFunctionget_request
(path: &str)
tests/compat/helpers.rs:86
↓ 12 callersMethodget_verification_by_identifier
( &self, identifier: &str, )
crates/core/src/hooks.rs:395
↓ 12 callersMethodsession_cookie
Build a `Set-Cookie` header value for a session token.
crates/core/src/plugin.rs:298
↓ 11 callersFunctioncreate_auth_request
(method: HttpMethod, path: &str, token: Option<&str>, body: Option<Vec<u8>>)
crates/better-auth-api/src/plugins/session_management.rs:368
next →1–100 of 2,120, ranked by callers