Skip to content

Commit

Permalink
Merge pull request #159 from waldo-vision/ts/disable
Browse files Browse the repository at this point in the history
disable turnstile stuff for now
  • Loading branch information
ceriddenn authored Mar 26, 2023
2 parents 8aef707 + 32ba42a commit 0cac94b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 42 deletions.
1 change: 0 additions & 1 deletion apps/web/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { prisma } from '@server/db/client';
import NextAuth from 'next-auth/next';
import { Profile, Session, User } from 'next-auth';
import { Roles } from 'database';
import { signIn } from 'next-auth/react';
import { Account } from 'next-auth';

const RicanGHId = '59850372';
Expand Down
34 changes: 17 additions & 17 deletions apps/web/pages/submissions/review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from '@chakra-ui/react';
import { useState, useEffect, ReactElement } from 'react';
import { useRouter } from 'next/router';
import Loading from '@components/Loading';
import Layout from '@components/Layout';
import { trpc } from '@utils/trpc';
import Head from 'next/head';
Expand Down Expand Up @@ -74,18 +73,18 @@ export default function Review() {

setLoading(true);

if (!isRequestValid) {
toast({
position: 'bottom-right',
title: 'Invalid Request',
description:
'Your request was deemed invalid. Please reload the page or try again.',
status: 'error',
duration: 5000,
isClosable: true,
});
return;
}
// if (!isRequestValid) {
// toast({
// position: 'bottom-right',
// title: 'Invalid Request',
// description:
// 'Your request was deemed invalid. Please reload the page or try again.',
// status: 'error',
// duration: 5000,
// isClosable: true,
// });
// return;
// }

const review = action === 'yes';
await reviewGameplay.mutateAsync({
Expand All @@ -109,10 +108,11 @@ export default function Review() {

useEffect(() => {
const getNecessaryData = async () => {
if (tsToken && tsToken.length > 3 && !reviewItemData) {
await refetch();
return;
}
// if (tsToken && tsToken.length > 3 && !reviewItemData) {
// await refetch();
// return;
// }
await refetch();
setReviewItem(reviewItemData);
if (error?.data?.code == 'NOT_FOUND') {
setFinished(true);
Expand Down
8 changes: 4 additions & 4 deletions apps/web/pages/submissions/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ export default function Upload() {
};

const handleClipUpload = async () => {
if (!isRequestValid) {
handleRequestError('Request Invalid. Reload and try again.');
return;
}
// if (!isRequestValid) {
// handleRequestError('Request Invalid. Reload and try again.');
// return;
// }
if (requestDone) {
setSelectedGame('');
setCurrentUrl('');
Expand Down
40 changes: 20 additions & 20 deletions apps/web/server/trpc/router/gameplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ export const gameplayRouter = router({
)
.output(GameplaySchema)
.mutation(async ({ input, ctx }) => {
const isPerson = await vUser(input.tsToken);
if (!isPerson) {
throw new TRPCError({
code: 'BAD_REQUEST',
message:
'We could not confirm if you were a legitimate user. Please refresh the page and try again.',
// not sure if its safe to give this to the user
cause: '',
});
}
// const isPerson = await vUser(input.tsToken);
// if (!isPerson) {
// throw new TRPCError({
// code: 'BAD_REQUEST',
// message:
// 'We could not confirm if you were a legitimate user. Please refresh the page and try again.',
// // not sure if its safe to give this to the user
// cause: '',
// });
// }
const existingGameplay = await ctx.prisma.gameplay.findUnique({
where: {
youtubeUrl: input.youtubeUrl,
Expand Down Expand Up @@ -449,16 +449,16 @@ export const gameplayRouter = router({
)
.output(ReviewItemsGameplaySchema)
.query(async ({ input, ctx }) => {
const isPerson = await vUser(input.tsToken);
if (!isPerson) {
throw new TRPCError({
code: 'BAD_REQUEST',
message:
'We could not confirm if you were a legitimate user. Please refresh the page and try again.',
// not sure if its safe to give this to the user
cause: '',
});
}
// const isPerson = await vUser(input.tsToken);
// if (!isPerson) {
// throw new TRPCError({
// code: 'BAD_REQUEST',
// message:
// 'We could not confirm if you were a legitimate user. Please refresh the page and try again.',
// // not sure if its safe to give this to the user
// cause: '',
// });
// }
const randomPick = (values: string[]) => {
const index = Math.floor(Math.random() * values.length);
return values[index];
Expand Down

0 comments on commit 0cac94b

Please sign in to comment.