mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-28 01:46:45 -05:00
chore: only show base url warning once
This commit is contained in:
@@ -104,10 +104,16 @@ export async function createAuthContext(
|
||||
const logger = createLogger(options.logger);
|
||||
const baseURL = getBaseURL(options.baseURL, options.basePath);
|
||||
|
||||
if (!baseURL && !options.advanced?.trustedProxyHeaders) {
|
||||
let showBaseURLWarning = false;
|
||||
if (
|
||||
!baseURL &&
|
||||
!options.advanced?.trustedProxyHeaders &&
|
||||
!showBaseURLWarning
|
||||
) {
|
||||
logger.error(
|
||||
`[better-auth] Base URL could not be determined. Please set a valid base URL using the baseURL config option or the BETTER_AUTH_BASE_URL environment variable. Without this, callbacks and redirects may not work correctly.`,
|
||||
);
|
||||
showBaseURLWarning = true;
|
||||
}
|
||||
|
||||
const secret =
|
||||
|
||||
Reference in New Issue
Block a user