Compare commits
No commits in common. "5fb708051b4c963fdf94eb8e4262ac2fe9f9eb2f" and "f22e63bd4d28cf29de5fa58a4e07decf62bc82ec" have entirely different histories.
5fb708051b
...
f22e63bd4d
|
|
@ -136,7 +136,6 @@ export default defineNuxtConfig({
|
||||||
tasks: true,
|
tasks: true,
|
||||||
},
|
},
|
||||||
rollupConfig: {
|
rollupConfig: {
|
||||||
external: ['bun'],
|
|
||||||
plugins: [
|
plugins: [
|
||||||
vuePlugin({ include: /\.vue$/, target: 'node' })
|
vuePlugin({ include: /\.vue$/, target: 'node' })
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ export default defineEventHandler(async (e): Promise<Return> => {
|
||||||
|
|
||||||
logSession(e, await setUserSession(e, { user: { id: id.id, username: body.data.username, email: body.data.email, state: 0, signin: new Date(), permissions: [] } }) as UserSessionRequired);
|
logSession(e, await setUserSession(e, { user: { id: id.id, username: body.data.username, email: body.data.email, state: 0, signin: new Date(), permissions: [] } }) as UserSessionRequired);
|
||||||
|
|
||||||
await runTask('mail', {
|
runTask('mail', {
|
||||||
payload: {
|
payload: {
|
||||||
type: 'mail',
|
type: 'mail',
|
||||||
to: [body.data.email],
|
to: [body.data.email],
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export default defineEventHandler(async (e) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await runTask('mail', {
|
runTask('mail', {
|
||||||
payload: {
|
payload: {
|
||||||
type: 'mail',
|
type: 'mail',
|
||||||
to: [session.user.email],
|
to: [session.user.email],
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<template>
|
||||||
|
<div class="">
|
||||||
|
<img />
|
||||||
|
<p>Bienvenue sur d[any], <span>{{ username }}</span>.</p>
|
||||||
|
</div>
|
||||||
|
<p class="">Nous vous invitons à valider votre compte en cliquant <a :href="`https://obsidian.peaceultime.com/user/mail-validation?u=${id}&t=${timestamp}&h=${hash(id.toString(), timestamp)}`"><Button>ici</Button></a> afin de profiter de toutes les fonctionnalités de d[any]</p>
|
||||||
|
<p class="">Vous pouvez egalement copier le lien suivant pour valider votre compte: {{ `https://obsidian.peaceultime.com/user/mail-validation?u=${id}&t=${timestamp}&h=${hash(id.toString(), timestamp)}` }}</p>
|
||||||
|
<span>Ce lien est valable 1 heure.</span>
|
||||||
|
<footer></footer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { hash } from 'bun';
|
||||||
|
|
||||||
|
const { id, username, timestamp } = defineProps<{
|
||||||
|
id: number
|
||||||
|
username: string
|
||||||
|
timestamp: number
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
|
@ -1,17 +1,20 @@
|
||||||
import nodemailer from 'nodemailer';
|
import nodemailer from 'nodemailer';
|
||||||
import { createSSRApp, h } from 'vue';
|
import { createSSRApp, h } from 'vue';
|
||||||
import { renderToString } from 'vue/server-renderer';
|
import { renderToString } from 'vue/server-renderer';
|
||||||
|
import postcss from 'postcss';
|
||||||
|
import tailwindcss from 'tailwindcss';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
|
||||||
import base from '../components/mail/base.vue';
|
import base from '../components/mail/base.vue';
|
||||||
import registration from '../components/mail/registration.vue';
|
import registration from '../components/mail/registration.vue';
|
||||||
//import revalidation from '../components/mail/revalidation.vue';
|
import revalidation from '../components/mail/revalidation.vue';
|
||||||
|
|
||||||
const config = useRuntimeConfig();
|
const config = useRuntimeConfig();
|
||||||
const [domain, selector, dkim] = config.mail.dkim.split(":");
|
const [domain, selector, dkim] = config.mail.dkim.split(":");
|
||||||
|
|
||||||
export const templates: Record<string, { component: any, subject: string }> = {
|
export const templates: Record<string, { component: any, subject: string }> = {
|
||||||
"registration": { component: registration, subject: 'Bienvenue sur d[any] 😎' },
|
"registration": { component: registration, subject: 'Bienvenue sur d[any] 😎' },
|
||||||
// "revalidate-mail": { component: revalidation, subject: 'd[any]: Valider votre email' },
|
"revalidate-mail": { component: revalidation, subject: 'd[any]: Valider votre email' },
|
||||||
};
|
};
|
||||||
|
|
||||||
import 'nitropack/types';
|
import 'nitropack/types';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import useDatabase from "~/composables/useDatabase";
|
import useDatabase from "~/composables/useDatabase";
|
||||||
import { extname, basename } from 'node:path';
|
import { extname, basename } from 'node:path';
|
||||||
import type { FileType } from '~/types/api';
|
import type { File, FileType, Tag } from '~/types/api';
|
||||||
import type { CanvasColor, CanvasContent } from "~/types/canvas";
|
import type { CanvasColor, CanvasContent } from "~/types/canvas";
|
||||||
import { explorerContentTable } from "~/db/schema";
|
import { explorerContentTable } from "~/db/schema";
|
||||||
|
|
||||||
|
|
@ -25,9 +25,9 @@ export default defineTask({
|
||||||
recursive: true,
|
recursive: true,
|
||||||
per_page: 1000,
|
per_page: 1000,
|
||||||
}
|
}
|
||||||
}) as { tree: any[] } & Record<string, any>;
|
}) as any;
|
||||||
|
|
||||||
const files: typeof explorerContentTable.$inferInsert = await Promise.all(tree.tree.filter((e: any) => !e.path.startsWith(".")).map(async (e, i) => {
|
const files: typeof explorerContentTable.$inferInsert = await Promise.all(tree.tree.filter((e: any) => !e.path.startsWith(".")).map(async (e: any) => {
|
||||||
if(e.type === 'tree')
|
if(e.type === 'tree')
|
||||||
{
|
{
|
||||||
const title = basename(e.path);
|
const title = basename(e.path);
|
||||||
|
|
@ -35,7 +35,7 @@ export default defineTask({
|
||||||
const path = (e.path as string).split('/').map(f => { const check = /(\d+)\. ?(.+)/gsmi.exec(f); return check && check[2] ? check[2] : f }).join('/');
|
const path = (e.path as string).split('/').map(f => { const check = /(\d+)\. ?(.+)/gsmi.exec(f); return check && check[2] ? check[2] : f }).join('/');
|
||||||
return {
|
return {
|
||||||
path: path.toLowerCase().replaceAll(" ", "-").normalize("NFD").replace(/[\u0300-\u036f]/g, ""),
|
path: path.toLowerCase().replaceAll(" ", "-").normalize("NFD").replace(/[\u0300-\u036f]/g, ""),
|
||||||
order: i,
|
order: order && order[1] ? order[1] : 0,
|
||||||
title: order && order[2] ? order[2] : title,
|
title: order && order[2] ? order[2] : title,
|
||||||
type: 'folder',
|
type: 'folder',
|
||||||
content: null,
|
content: null,
|
||||||
|
|
@ -53,7 +53,7 @@ export default defineTask({
|
||||||
|
|
||||||
return {
|
return {
|
||||||
path: (extension === '.md' ? path.replace(extension, '') : path).toLowerCase().replaceAll(" ", "-").normalize("NFD").replace(/[\u0300-\u036f]/g, ""),
|
path: (extension === '.md' ? path.replace(extension, '') : path).toLowerCase().replaceAll(" ", "-").normalize("NFD").replace(/[\u0300-\u036f]/g, ""),
|
||||||
order: i,
|
order: order && order[1] ? order[1] : 0,
|
||||||
title: order && order[2] ? order[2] : title,
|
title: order && order[2] ? order[2] : title,
|
||||||
type: (typeMapping[extension] ?? 'file'),
|
type: (typeMapping[extension] ?? 'file'),
|
||||||
content: reshapeContent(content as string, typeMapping[extension] ?? 'File'),
|
content: reshapeContent(content as string, typeMapping[extension] ?? 'File'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue