mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix: trusted url missing, better auth crash due to update (#240)
* fix: release.yml * fix: S3ChannelConfigSchema type port mismatch * chore: package.json * fix: refactoring logs and adding pino logger for production and dev. * fix: trusted url error due to better auth update. --------- Co-authored-by: charlesgauthereau <charles.gauthereau@soluce-technologies.com> Co-authored-by: killianlarcher <killian.larcher@soluce-technologies.com>
This commit is contained in:
co-authored by
charlesgauthereau
killianlarcher
parent
203c25aabe
commit
dd85f7a25d
+19
-1
@@ -516,9 +516,27 @@ export const auth = betterAuth({
|
||||
},
|
||||
},
|
||||
},*/
|
||||
trustedOrigins: [env.PROJECT_URL!, "http://app"],
|
||||
// trustedOrigins: [env.PROJECT_URL!, "http://app"],
|
||||
trustedOrigins: async (request) => {
|
||||
const trustedOrigins = await queryTrustedDomains();
|
||||
return trustedOrigins;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const queryTrustedDomains = async (): Promise<string[]> => {
|
||||
const envDomains = env.TRUSTED_DOMAINS || "";
|
||||
const domains = envDomains
|
||||
.split(",")
|
||||
.map((d) => d.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
if (env.PROJECT_URL) domains.push(env.PROJECT_URL);
|
||||
domains.push("http://app")
|
||||
|
||||
return domains;
|
||||
};
|
||||
|
||||
/*export const signUpUser = async (email: string, password: string, name: string) => {
|
||||
const user = await auth.api.signUpEmail({
|
||||
body: {
|
||||
|
||||
Reference in New Issue
Block a user