diff --git a/Dockerfile b/Dockerfile index 62f19d118..cdff362d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ RUN node --version RUN rm -rvf /app/node_modules RUN git clone https://github.com/2anki/web /app/web -RUN git -C /app/web checkout 2c195d254bef9398db2a32888f570b8bf1e765d8 RUN git clone https://github.com/2anki/create_deck /app/create_deck RUN npm --prefix /app/web install diff --git a/migrations/20221029071325_remove-verify-user.js b/migrations/20221029071325_remove-verify-user.js new file mode 100644 index 000000000..00d625e7a --- /dev/null +++ b/migrations/20221029071325_remove-verify-user.js @@ -0,0 +1,13 @@ +exports.up = function (knex) { + return knex.schema.table('users', (table) => { + table.dropColumn('verification_token'); + table.dropColumn('verified'); + }); +}; + +module.exports.down = (knex) => { + return knex.schema.table('users', (table) => { + table.boolean('verified').defaultTo(true); + table.string('verification_token'); + }); +}; diff --git a/package-lock.json b/package-lock.json index ea46a76a3..50ddfaa93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "notion2anki-server", - "version": "1.0.0-alpha.32", + "version": "1.0.0-alpha.35", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "notion2anki-server", - "version": "1.0.0-alpha.32", + "version": "1.0.0-alpha.35", "license": "MIT", "dependencies": { "@notionhq/client": "^0.4.12", diff --git a/package.json b/package.json index eefa0a5c5..e52658b67 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "notion2anki" ], "author": "Alexander Alemayhu", - "version": "1.0.0-alpha.32", + "version": "1.0.0-alpha.35", "engines": { "node": ">=12.0.0" }, diff --git a/src/lib/email/EmailHandler.ts b/src/lib/email/EmailHandler.ts index 01d1cb9ab..c51941562 100644 --- a/src/lib/email/EmailHandler.ts +++ b/src/lib/email/EmailHandler.ts @@ -3,10 +3,6 @@ import fs from 'fs'; const EMAIL_TEMPLATES_DIRECTORY = path.join(__dirname, 'templates'); -const VERIFICATION_TEMPLATE = fs.readFileSync( - path.join(EMAIL_TEMPLATES_DIRECTORY, 'verification.html'), - 'utf8' -); const PASSWORD_RESET_TEMPLATE = fs.readFileSync( path.join(EMAIL_TEMPLATES_DIRECTORY, 'reset.html'), 'utf8' @@ -40,21 +36,6 @@ class EmailHandler { return sgMail.send(msg); } - static async SendVerificationEmail(email: string, token: string) { - const link = `${process.env.DOMAIN}/api/users/v/${token}`; - const markup = VERIFICATION_TEMPLATE.replace('{{link}}', link); - const msg = { - to: email, - from: DEFAULT_SENDER, - subject: 'Verify your 2anki.net account', - text: `Please verify your account by visiting the following link ${link}`, - html: markup, - replyTo: 'alexander@alemayhu.com', - }; - - return sgMail.send(msg); - } - static async SendConversionEmail( email: string, filename: string, diff --git a/src/lib/email/templates/verification.html b/src/lib/email/templates/verification.html deleted file mode 100644 index eac9e2d3e..000000000 --- a/src/lib/email/templates/verification.html +++ /dev/null @@ -1,35 +0,0 @@ - - -
- - -- Please verify your account by visiting the link below -
- verify -- If you are having any issues, don't hesitate to ask for help! Reply to - this email or join Discord https://alemayhu.com/discord -
-Thank you!
-Alexander Alemayhu Developer of 2anki.net
-- If you did not create an account, please contact me - alexander@alemayhu.com. -
-