Skip to content

Commit

Permalink
Email service upgrade (#176)
Browse files Browse the repository at this point in the history
* email upgrade + fixes

* email fixes

* add email test server
  • Loading branch information
hingobway authored Sep 15, 2024
1 parent c6cbb08 commit f168ae7
Show file tree
Hide file tree
Showing 24 changed files with 1,674 additions and 134 deletions.
8 changes: 7 additions & 1 deletion client/src/app/auth/login/_components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ export default function LoginForm() {
await magicLinkFn.mutateAsync({ email, redirect: redirectTo });
notifications.show({
title: 'Login link sent',
message: 'Check your email!',
message: (
<>
Check your email!
<br />
(You might need to check your spam filter.)
</>
),
});
setEmail('');
} catch (e) {
Expand Down
7 changes: 5 additions & 2 deletions client/src/app/auth/logout/_components/LogoutAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ export default function LogoutAction() {

// notice when the user object disappears
const user = useUser();
const router = useRouter();
useEffect(() => {
if (!user) router.push('/');
if (!user) {
if (window) {
window.location.href = '/';
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [user]);

Expand Down
1 change: 1 addition & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
.serverless
.env
.esbuild/
.dist/
11 changes: 9 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "epc-next__server",
"private": true,
"scripts": {
"dev": "nodemon --exec \"sls offline start\"",
"dev": "nodemon --exec \"sls offline start\" -e js,mjs,cjs,json,tsx",
"push": "sls deploy",
"gql:gen": "graphql-codegen -c ./src/db/codegen.ts",
"postinstall": "pnpm run gql:gen"
"postinstall": "pnpm run gql:gen",
"email:dev": "email dev --dir \"src/email/templates\" --port 3008"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.590.0",
Expand All @@ -17,6 +18,8 @@
"@getbrevo/brevo": "^2.1.1",
"@graphql-typed-document-node/core": "^3.2.0",
"@passwordlessdev/passwordless-nodejs": "^0.2.0",
"@react-email/components": "^0.0.25",
"@react-email/render": "^1.0.1",
"@trpc/server": "11.0.0-rc.396",
"axios": "^1.7.2",
"cors": "^2.8.5",
Expand All @@ -34,11 +37,13 @@
"jose": "^5.4.0",
"mime": "^4.0.3",
"qs": "^6.12.1",
"react-dom": "^18.3.1",
"rehype-stringify": "^10.0.0",
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.0",
"resend": "^4.0.0",
"serverless-http": "^3.2.0",
"textversionjs": "^1.1.3",
"unified": "^11.0.4",
Expand All @@ -55,10 +60,12 @@
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/qs": "^6.9.15",
"@types/react-dom": "^18.3.0",
"@types/textversionjs": "^1.1.4",
"dotenv": "^16.4.5",
"esbuild": "^0.20.0",
"nodemon": "^3.1.3",
"react-email": "^3.0.1",
"serverless-esbuild": "^1.52.1",
"serverless-ignore": "^0.2.1",
"serverless-offline": "^13.6.0",
Expand Down
Loading

0 comments on commit f168ae7

Please sign in to comment.