fix: convert async function to sync function

This commit is contained in:
Elias Schneider
2022-12-02 14:43:52 +01:00
parent b649d8bf8e
commit 1dbfe0bbc9
3 changed files with 8 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ export class EmailService {
if (!this.config.get("emailRecepientsEnabled"))
throw new InternalServerErrorException("Email service disabled");
const shareUrl = `${this.config.get("APP_URL")}/share/${shareId}`;
const shareUrl = `${this.config.get("appUrl")}/share/${shareId}`;
await transporter.sendMail({

View File

@@ -78,14 +78,15 @@ export class FileService {
return fs.createReadStream(`./data/uploads/shares/${shareId}/archive.zip`);
}
async getFileDownloadUrl(shareId: string, fileId: string) {
getFileDownloadUrl(shareId: string, fileId: string) {
const downloadToken = this.generateFileDownloadToken(shareId, fileId);
return `${this.config.get(
"APP_URL"
"appUrl"
)}/api/shares/${shareId}/files/${fileId}?token=${downloadToken}`;
}
async generateFileDownloadToken(shareId: string, fileId: string) {
generateFileDownloadToken(shareId: string, fileId: string) {
if (fileId == "zip") fileId = undefined;
return this.jwtService.sign(
@@ -100,7 +101,7 @@ export class FileService {
);
}
async verifyFileDownloadToken(shareId: string, token: string) {
verifyFileDownloadToken(shareId: string, token: string) {
try {
const claims = this.jwtService.verify(token, {
secret: this.config.get("jwtSecret"),