Skip to content

Commit

Permalink
Merge pull request #26 from lowdefy/escape-host
Browse files Browse the repository at this point in the history
Escape host
  • Loading branch information
SamTolmay authored Nov 14, 2023
2 parents e5cbf7b + 55e37da commit 121fcb1
Show file tree
Hide file tree
Showing 16 changed files with 1,559 additions and 1,051 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-swans-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lowdefy/community-plugin-nodemailer': patch
---

Escape host on email template.
7 changes: 7 additions & 0 deletions .changeset/dirty-fishes-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@lowdefy/community-plugin-nodemailer': patch
'@lowdefy/community-plugin-mongodb': patch
'@lowdefy/community-plugin-auth': patch
---

Unpin next-auth dependency.
5 changes: 5 additions & 0 deletions .changeset/polite-trains-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lowdefy/community-plugin-mongodb': patch
---

Unpin uuid dependency.
5 changes: 5 additions & 0 deletions .changeset/strong-islands-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lowdefy/community-plugin-auth': patch
---

Update dependency jsonwebtoken to v9.0.2.
5 changes: 5 additions & 0 deletions .changeset/wet-snails-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lowdefy/community-plugin-nodemailer': patch
---

Update dependency nodemailer to v6.9.7.
2 changes: 1 addition & 1 deletion apps/docs/lowdefy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lowdefy: 4.0.0-rc.11
lowdefy: 4.0.0-rc.12
license: MIT

plugins:
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"lowdefy:start": "lowdefy start"
},
"dependencies": {
"lowdefy": "4.0.0-rc.11"
"lowdefy": "4.0.0-rc.12"
}
}
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
"license": "MIT",
"packageManager": "[email protected]",
"private": true,
"dependencies": {},
"scripts": {
"changeset": "changeset",
"publish": "changeset publish",
"test": "pnpm -r test",
"update-packages": "pnpm up -i -r --latest"
},
"devDependencies": {
"eslint": "8.45.0",
"eslint-config-prettier": "8.8.0",
"eslint-import-resolver-node": "0.3.7",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.32.2",
"@changesets/cli": "2.26.2",
"eslint": "8.53.0",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-node": "0.3.9",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "5.0.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"@changesets/cli": "2.26.0",
"prettier": "^2.8.4"
"prettier": "^3.0.3"
}
}
6 changes: 3 additions & 3 deletions plugins/community-plugin-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"prepare": "pnpm build"
},
"dependencies": {
"jsonwebtoken": "8.5.1",
"next-auth": "4.22.1"
"jsonwebtoken": "9.0.2",
"next-auth": "4"
},
"devDependencies": {
"@swc/cli": "0.1.62",
"@swc/core": "1.3.66"
"@swc/core": "1.3.96"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion plugins/community-plugin-confetti/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@swc/cli": "0.1.62",
"@swc/core": "1.3.66"
"@swc/core": "1.3.96"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion plugins/community-plugin-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@swc/cli": "0.1.62",
"@swc/core": "1.3.66"
"@swc/core": "1.3.96"
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 6 additions & 6 deletions plugins/community-plugin-mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
},
"dependencies": {
"@lowdefy/helpers": "^4.0.0-rc.11",
"@lowdefy/connection-mongodb": "^4.0.0-rc.11",
"@lowdefy/connection-mongodb": "^4.0.0-rc.12",
"@lowdefy/helpers": "^4.0.0-rc.12",
"mongodb": "5.6.0",
"next-auth": "4.22.1",
"next-auth": "4",
"saslprep": "1.0.3",
"uuid": "9.0.0"
"uuid": "9"
},
"devDependencies": {
"@lowdefy/ajv": "^4.0.0-rc.11",
"@lowdefy/ajv": "^4.0.0-rc.12",
"@shelf/jest-mongodb": "4.1.4",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.66",
"@swc/core": "1.3.96",
"@swc/jest": "0.2.27",
"jest": "28.1.3",
"jest-environment-node": "28.1.3"
Expand Down
8 changes: 4 additions & 4 deletions plugins/community-plugin-nodemailer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"prepare": "pnpm build"
},
"dependencies": {
"next-auth": "4.22.1",
"nodemailer": "6.9.3",
"@lowdefy/nunjucks": "^4.0.0-rc.11"
"@lowdefy/nunjucks": "^4.0.0-rc.12",
"next-auth": "4",
"nodemailer": "6.9.7"
},
"devDependencies": {
"@swc/cli": "0.1.62",
"@swc/core": "1.3.66"
"@swc/core": "1.3.96"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ const defaultTemplate = `
<html lang="en">
<head data-id="__react-email-head"></head>
<div id="__react-email-preview" style="display:none;overflow:hidden;line-height:1px;opacity:0;max-height:0;max-width:0">Sign in to {{ templateVariables.appName or escapedHost }}<div> ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏</div>
<div id="__react-email-preview" style="display:none;overflow:hidden;line-height:1px;opacity:0;max-height:0;max-width:0">Sign in to {{ templateVariables.appName or host }}<div> ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏</div>
</div>
<body data-id="__react-email-body" style="background-color:#f6f9fc;font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,&quot;Helvetica Neue&quot;,Ubuntu,sans-serif">
<table align="center" width="100%" data-id="__react-email-container" role="presentation" cellSpacing="0" cellPadding="0" border="0" style="max-width:37.5em;margin:0 auto;padding:24px;margin-bottom:64px;text-align:center">
<tbody>
<tr style="width:100%">
<td><img data-id="react-email-img" alt="{{ templateVariables.appName or escapedHost }}" src="{{ theme.logo or 'https://lowdefy.com/logo-light-theme.png' }}" style="display:block;outline:none;border:none;text-decoration:none;height:{{ templateVariables.logoHeight or '32px' }}" />
<td><img data-id="react-email-img" alt="{{ templateVariables.appName or host }}" src="{{ theme.logo or 'https://lowdefy.com/logo-light-theme.png' }}" style="display:block;outline:none;border:none;text-decoration:none;height:{{ templateVariables.logoHeight or '32px' }}" />
<table align="center" width="100%" data-id="__react-email-container" role="presentation" cellSpacing="0" cellPadding="0" border="0" style="max-width:37.5em;background-color:#ffffff;margin:24px auto 12px auto;padding:16px;border:1px solid #dedede;border-radius:4px">
<tbody>
<tr style="width:100%">
Expand All @@ -22,7 +22,7 @@ const defaultTemplate = `
<tbody>
<tr>
<td>
<p data-id="react-email-text" style="font-size:1.1em;line-height:24px;margin:16px 0;text-align:left">Click to sign in to {{ templateVariables.appName or escapedHost }}</p><a href="{{ url }}" data-id="react-email-button" target="_blank" style="background-color:{{ theme.brandColor or '#1990FF' }};border-radius:4px;color:{{ theme.buttonText or '#ffffff' }};font-size:1em;font-weight:bold;text-decoration:none;text-align:center;display:inline-block;width:120px;line-height:100%;max-width:100%;padding:10px 10px"><span><!--[if mso]><i style="letter-spacing: 10px;mso-font-width:-100%;mso-text-raise:15" hidden>&nbsp;</i><![endif]--></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:7.5px">Sign In</span><span><!--[if mso]><i style="letter-spacing: 10px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]--></span></a>
<p data-id="react-email-text" style="font-size:1.1em;line-height:24px;margin:16px 0;text-align:left">Click to sign in to {{ templateVariables.appName or host }}</p><a href="{{ url }}" data-id="react-email-button" target="_blank" style="background-color:{{ theme.brandColor or '#1990FF' }};border-radius:4px;color:{{ theme.buttonText or '#ffffff' }};font-size:1em;font-weight:bold;text-decoration:none;text-align:center;display:inline-block;width:120px;line-height:100%;max-width:100%;padding:10px 10px"><span><!--[if mso]><i style="letter-spacing: 10px;mso-font-width:-100%;mso-text-raise:15" hidden>&nbsp;</i><![endif]--></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:7.5px">Sign In</span><span><!--[if mso]><i style="letter-spacing: 10px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]--></span></a>
<p data-id="react-email-text" style="font-size:0.85em;line-height:1.3em;margin:16px 0;color:#848484;text-align:left;word-break:break-all;max-width:420px"> Or follow this url to sign in:<br /><a href="{{ url }}" data-id="react-email-link" target="_blank" style="color:#067df7;text-decoration:none;font-size:0.75em">{{ url }}</a><br /></p>
<p data-id="react-email-text" style="font-size:0.85em;line-height:24px;margin:16px 0;text-align:left">If you did not request this email you can safely ignore it.</p>
</td>
Expand All @@ -47,9 +47,8 @@ function html({ host, template, templateVariables, theme, url }) {
// Insert invisible space into domains from being turned into a hyperlink by email
// clients like Outlook and Apple mail, as this is confusing because it seems
// like they are supposed to click on it to sign in.
const escapedHost = host.replace(/\./g, '&#8203;.');
return nunjucksFunction(defaultTemplate ?? template)({
host: escapedHost,
host: host.replace(/\./g, '&#8203;.'),
templateVariables,
theme,
url,
Expand Down
6 changes: 3 additions & 3 deletions plugins/community-plugin-xlsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"prepare": "pnpm build"
},
"dependencies": {
"@lowdefy/helpers": "^4.0.0-rc.11",
"@lowdefy/helpers": "^4.0.0-rc.12",
"write-excel-file": "1.4.27"
},
"devDependencies": {
"@swc/cli": "0.1.57",
"@swc/core": "1.2.194"
"@swc/cli": "0.1.62",
"@swc/core": "1.3.96"
},
"publishConfig": {
"access": "public"
Expand Down
Loading

0 comments on commit 121fcb1

Please sign in to comment.