Skip to content

Commit

Permalink
some server work as well
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCactusBlue committed Jan 28, 2025
1 parent d47a165 commit a75a5d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ function EditDialog(props: {
}
)) {
const domainFormSchema = yup.object({
domain: urlSchema
.url("Invalid URL")
.transform((value) => 'https://' + value)
domain: yup.string()
// .url("Invalid URL")
.notOneOf(
props.domains
.filter((_, i) => (props.type === 'update' && i !== props.editIndex) || props.type === 'create')
Expand Down Expand Up @@ -86,11 +85,11 @@ function EditDialog(props: {
domains: [
...props.domains,
{
domain: values.domain,
domain: (values.allowInsecureHttp ? 'http' : 'https') + `://` + values.domain,
handlerPath: values.handlerPath,
},
...(canAddWww(values.domain.slice(8)) && values.addWww ? [{
domain: 'https://www.' + values.domain.slice(8),
...(canAddWww(values.domain) && values.addWww ? [{
domain: `${values.allowInsecureHttp ? 'http' : 'https'}://www.` + values.domain,
handlerPath: values.handlerPath,
}] : []),
],
Expand Down Expand Up @@ -147,7 +146,7 @@ function EditDialog(props: {
<Typography variant="secondary" type="footnote">
only modify this if you changed the default handler path in your app
</Typography>
<div className="mt-4">
<div className="my-4">
<SwitchField
label="Allow insecure HTTP domains"
name="allowInsecureHttp"
Expand Down
2 changes: 1 addition & 1 deletion packages/stack-shared/src/interface/crud/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const emailConfigSchema = yupObject({
});

const domainSchema = yupObject({
domain: schemaFields.projectTrustedDomainSchema.defined(),
domain: schemaFields.urlSchema.defined(),
handler_path: schemaFields.handlerPathSchema.defined(),
});

Expand Down

0 comments on commit a75a5d6

Please sign in to comment.