diff --git a/README.md b/README.md index 7bd881a..32ae678 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,6 @@ You can set yourself as an administrator by chaing the "role" column to "admin" | IRON_SECRET | Secret for Iron to encrypt the cookie | stringwithatleast64chars | | DISCORD_CLIENT_ID | Discord Client ID | | | DISCORD_CLIENT_SECRET | Discord Client Secret | | -| TWITTER_API_KEY | Twitter API Key | | -| TWITTER_API_SECRET_KEY | Twitter API Secret Key | | | WEBPACK_ANALYZE | Runs Webpack Analyzer on start | true | | NEXT_PUBLIC_LOGGING_LEVEL | Logging Level | TRACE, DEBUG, INFO, WARNING, ERROR or CRITICAL | | NEXT_PUBLIC_STAGING | If the instance is a staging instance where data may be deleted | true | diff --git a/prisma/schema.prisma b/prisma/schema.prisma index c99015a..a9d10a2 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -126,10 +126,10 @@ model user { created_at DateTime @default(dbgenerated("CURRENT_TIMESTAMP(3)")) updated_at DateTime @default(dbgenerated("CURRENT_TIMESTAMP(3)")) badge String? @db.VarChar(50) + language String @default("en") @db.VarChar(11) isBanned Int @default(0) @db.SmallInt isPublic Int @default(1) @db.SmallInt publicOverride Int? @db.SmallInt - language String @default("en") @db.VarChar(11) accounts accounts[] banned_user banned_user[] game_sessions game_sessions[] diff --git a/src/components/shared/AppNavbar.jsx b/src/components/shared/AppNavbar.jsx index 72ee9d5..e819162 100644 --- a/src/components/shared/AppNavbar.jsx +++ b/src/components/shared/AppNavbar.jsx @@ -41,7 +41,6 @@ function AppNavbar () { LinkTag Logo diff --git a/src/lib/utils/oAuthUtils.js b/src/lib/utils/oAuthUtils.js deleted file mode 100644 index bcea03c..0000000 --- a/src/lib/utils/oAuthUtils.js +++ /dev/null @@ -1,24 +0,0 @@ -import Twitter from 'twitter-lite' -import ENV from '@/lib/constants/environmentVariables' -import prisma from '@/lib/db' - -export const LOGIN_ERROR_URI = `${ENV.BASE_URL}/?error=1` - -export async function linkAccount (providerId, providerAccountId, username) { - await prisma.account.create({ - data: { - provider_id: providerId, - provider_account_id: providerAccountId, - user: { - connect: { - username - } - } - } - }) -} - -export const twitter = new Twitter({ - consumer_key: ENV.TWITTER_API_KEY, - consumer_secret: ENV.TWITTER_API_SECRET -}) diff --git a/src/pages/api/auth/login/discord.js b/src/pages/api/auth/login/discord.js index 3653816..ee3952f 100644 --- a/src/pages/api/auth/login/discord.js +++ b/src/pages/api/auth/login/discord.js @@ -1,6 +1,5 @@ import { ncWithSession } from '@/lib/routing' import { generateRandomKey, isBlank } from '@/lib/utils/utils' -import { LOGIN_ERROR_URI } from '@/lib/utils/oAuthUtils' import logger from '@/lib/logger' import prisma from '@/lib/db' import ENV from '@/lib/constants/environmentVariables' @@ -9,6 +8,7 @@ import HTTP_CODE from '@/lib/constants/httpStatusCodes' const PROVIDER_ID = 'discord' const BASE_URL = 'https://discord.com/api' const REDIRECT_URI = `${ENV.BASE_URL}/api/auth/login/discord` +const LOGIN_ERROR_URI = `${ENV.BASE_URL}/?error=1` async function generateAuthorizeUrl (request, response) { const authUri = new URL(`${BASE_URL}/oauth2/authorize`)