Skip to content

Commit

Permalink
fix: Sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-dalmet committed Sep 26, 2023
1 parent 55fd688 commit 1ba870a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/features/auth/PageRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import { Icon } from '@/components/Icons';
import { SlideIn } from '@/components/SlideIn';
import { useToastError } from '@/components/Toast';
import { DemoRegisterHint } from '@/features/demo-mode/DemoRegisterHint';
import { AVAILABLE_LANGUAGES } from '@/lib/i18n/constants';
import { Language } from '@/lib/i18n/constants';
import { AVAILABLE_LANGUAGES, Language } from '@/lib/i18n/constants';
import { trpc } from '@/lib/trpc/client';

export default function PageRegister() {
Expand Down
3 changes: 1 addition & 2 deletions src/features/repositories/PageRepository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ import {
import Link from 'next/link';
import { useParams, useRouter } from 'next/navigation';
import { useTranslation } from 'react-i18next';
import { LuPenLine, LuExternalLink, LuTrash2 } from 'react-icons/lu';
import { LuExternalLink, LuPenLine, LuTrash2 } from 'react-icons/lu';

// import { Link, useNavigate, useParams } from 'react-router-dom';
import { ConfirmModal } from '@/components/ConfirmModal';
import { ErrorPage } from '@/components/ErrorPage';
import { Icon } from '@/components/Icons';
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const createTRPCRouter = t.router;

/** Reusable middleware that enforces users are logged in before running the procedure. */
const enforceUserIsAuthed = t.middleware(({ ctx, next }) => {
if (!ctx.user || !ctx.user.activated || !ctx.user.emailVerified) {
if (!ctx.user?.activated || !ctx.user?.emailVerified) {
throw new TRPCError({
code: 'UNAUTHORIZED',
message: ctx.user?.email,
Expand Down

0 comments on commit 1ba870a

Please sign in to comment.