mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-12 23:05:39 +01:00
Format everything
This commit is contained in:
@@ -3,7 +3,10 @@ import { JwtModule } from '@nestjs/jwt';
|
||||
import { PassportModule } from '@nestjs/passport';
|
||||
import { PreferenceModule } from '../../collections/preference-db/preference-db.module';
|
||||
import { UsersModule } from '../../collections/user-db/user-db.module';
|
||||
import { JwtConfigService, JwtSecretProvider } from '../../config/late/jwt.config.service';
|
||||
import {
|
||||
JwtConfigService,
|
||||
JwtSecretProvider,
|
||||
} from '../../config/late/jwt.config.service';
|
||||
import { LateConfigModule } from '../../config/late/late-config.module';
|
||||
import { AuthManagerService } from './auth.service';
|
||||
import { GuestStrategy } from './guards/guest.strategy';
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
ForbiddenException,
|
||||
Injectable,
|
||||
InternalServerErrorException,
|
||||
Logger
|
||||
Logger,
|
||||
} from '@nestjs/common';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
@@ -47,14 +47,18 @@ export class MainAuthGuard extends AuthGuard(['jwt', 'guest']) {
|
||||
// These are the permissions required to access the route
|
||||
const permissions = this.extractPermissions(context);
|
||||
if (HasFailed(permissions)) {
|
||||
this.logger.error('Fetching route permission failed: ' + permissions.getReason());
|
||||
this.logger.error(
|
||||
'Fetching route permission failed: ' + permissions.getReason(),
|
||||
);
|
||||
throw new InternalServerErrorException();
|
||||
}
|
||||
|
||||
// These are the permissions the user has
|
||||
const userPermissions = await this.usersService.getPermissions(user.id);
|
||||
if (HasFailed(userPermissions)) {
|
||||
this.logger.warn('Fetching user permissions failed: ' + userPermissions.getReason());
|
||||
this.logger.warn(
|
||||
'Fetching user permissions failed: ' + userPermissions.getReason(),
|
||||
);
|
||||
throw new InternalServerErrorException();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import ms from 'ms';
|
||||
import { ImageRequestParams } from 'picsur-shared/dist/dto/api/image.dto';
|
||||
import {
|
||||
FullMime,
|
||||
SupportedMimeCategory
|
||||
SupportedMimeCategory,
|
||||
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||
import { SysPreference } from 'picsur-shared/dist/dto/sys-preferences.dto';
|
||||
import { AsyncFailable, Fail, HasFailed } from 'picsur-shared/dist/types';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
|
||||
import {
|
||||
FullMime,
|
||||
ImageMime,
|
||||
SupportedMimeCategory
|
||||
SupportedMimeCategory,
|
||||
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||
import { AsyncFailable, Fail } from 'picsur-shared/dist/types';
|
||||
import { QOIColorSpace, QOIencode } from 'qoi-img';
|
||||
|
||||
@@ -10,11 +10,10 @@ export function UniversalSharp(
|
||||
): Sharp {
|
||||
// if (mime.mime === ImageMime.ICO) {
|
||||
// return icoSharp(image, options);
|
||||
// } else
|
||||
// } else
|
||||
if (mime.mime === ImageMime.BMP) {
|
||||
return bmpSharp(image, options);
|
||||
} else
|
||||
if (mime.mime === ImageMime.QOI) {
|
||||
} else if (mime.mime === ImageMime.QOI) {
|
||||
return qoiSharp(image, options);
|
||||
} else {
|
||||
return sharp(image, options);
|
||||
|
||||
Reference in New Issue
Block a user