mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
fix(core): strip trailing slashes when normalizing auth and MCP resource URLs (#506)
* fix(core): strip trailing slashes when normalizing auth and MCP resource URLs * docs: document BETTER_AUTH_URL in README and quickstart guides * docs: prioritize AWS_ENDPOINT_URL_S3 and clarify applicability to local storage * docs: refine AWS_ENDPOINT_URL_S3 guidance for local storage deployments
This commit is contained in:
@@ -16,8 +16,9 @@ interface GeneratedResetLink {
|
||||
|
||||
const resetLinkStorage = new AsyncLocalStorage<GeneratedResetLink>()
|
||||
|
||||
export const authBaseUrl =
|
||||
export const authBaseUrl = (
|
||||
process.env.BETTER_AUTH_URL || `http://localhost:${process.env.SHUMAI_SERVER_PORT || '3000'}`
|
||||
).replace(/\/+$/, '')
|
||||
export const mcpResource = `${authBaseUrl}/mcp`
|
||||
export { hashPassword } from 'better-auth/crypto'
|
||||
|
||||
@@ -202,7 +203,7 @@ export class AuthService {
|
||||
const rawBaseUrl =
|
||||
process.env.BETTER_AUTH_URL ||
|
||||
`http://localhost:${process.env.SHUMAI_SERVER_PORT || '3000'}`
|
||||
const baseUrl = rawBaseUrl.replace(/\/$/, '')
|
||||
const baseUrl = rawBaseUrl.replace(/\/+$/, '')
|
||||
return `${baseUrl}/reset-password?token=${context.token}`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user