Skip to content

Commit

Permalink
Upgraded remix-auth-oauth2 to latest version (2.3.0)
Browse files Browse the repository at this point in the history
- Refactored OAuth2Strategy constructor fields to the ones mentioned in the official documentation: https://github.com/sergiodxa/remix-auth-oauth2?tab=readme-ov-file#directly
- Issue Link: Sendouc#1852
  • Loading branch information
ElementUser committed Aug 25, 2024
1 parent f86548c commit 963e793
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 118 deletions.
11 changes: 6 additions & 5 deletions app/features/auth/core/DiscordStrategy.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@ export class DiscordStrategy extends OAuth2Strategy<

super(
{
authorizationURL: "https://discord.com/api/oauth2/authorize",
tokenURL:
authorizationEndpoint: "https://discord.com/api/oauth2/authorize",
tokenEndpoint:
process.env.AUTH_GATEWAY_TOKEN_URL ??
"https://discord.com/api/oauth2/token",
clientID: envVars.DISCORD_CLIENT_ID,
clientId: envVars.DISCORD_CLIENT_ID,
clientSecret: envVars.DISCORD_CLIENT_SECRET,
callbackURL: new URL("/auth/callback", envVars.BASE_URL).toString(),
redirectURI: new URL("/auth/callback", envVars.BASE_URL).toString(),
},
async ({ accessToken }) => {
async ({ tokens }) => {
try {
const { access_token: accessToken } = tokens;
const discordResponses = this.authGatewayEnabled()
? await this.fetchProfileViaGateway(accessToken)
: await this.fetchProfileViaDiscordApi(accessToken);
Expand Down
Binary file modified bun.lockb
Binary file not shown.
226 changes: 113 additions & 113 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,115 +1,115 @@
{
"name": "sendou.ink",
"version": "3.0.0",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"deploy": "bun install --frozen-lockfile && bun run build",
"build": "remix vite:build",
"dev": "remix vite:dev --host",
"dev:prod": "DB_PATH=db-prod.sqlite3 bun run dev",
"dev:ci": "cp .env.example .env && bun run migrate up && bun run dev",
"start": "npm run migrate up && remix-serve ./build/server/index.js",
"migrate": "ley",
"migrate:reset": "bun scripts/delete-db-files.mjs && bun run migrate up",
"check-translation-jsons": "bun scripts/check-translation-jsons.ts",
"check-translation-jsons:no-write": "bun scripts/check-translation-jsons.ts --no-write",
"refresh-prod-db": "bun scripts/refresh-prod-db.ts && DB_PATH=db-prod.sqlite3 bun migrate up",
"biome:check": "bunx @biomejs/biome check .",
"biome:fix": "bunx @biomejs/biome check --write .",
"biome:fix:unsafe": "bunx @biomejs/biome check --write --unsafe .",
"typecheck": "tsc --noEmit",
"test:unit": "NODE_ENV=test bun test",
"test:unit:all": "bun test:unit app",
"test:e2e": "bunx playwright test",
"cf": "bun run biome:fix && bun run test:unit:all && bun run check-translation-jsons && bun run typecheck && bun run test:e2e",
"cf:noe2e": "bun run biome:fix && bun run test:unit:all && bun run check-translation-jsons && bun run typecheck"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.637.0",
"@aws-sdk/lib-storage": "^3.637.0",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@epic-web/cachified": "^5.2.0",
"@faker-js/faker": "^8.4.1",
"@headlessui/react": "^1.7.19",
"@hookform/resolvers": "^3.9.0",
"@popperjs/core": "^2.11.8",
"@remix-run/node": "^2.11.2",
"@remix-run/react": "^2.11.2",
"@remix-run/serve": "^2.11.2",
"@tldraw/tldraw": "2.3.0",
"aws-sdk": "^2.1682.0",
"better-sqlite3": "^11.2.1",
"clsx": "^2.1.1",
"compressorjs": "^1.2.1",
"countries-list": "^3.1.1",
"date-fns": "^3.6.0",
"fuse.js": "^7.0.0",
"gray-matter": "^4.0.3",
"i18next": "^23.14.0",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-http-backend": "^2.6.1",
"isbot": "^5.1.17",
"just-camel-case": "^6.2.0",
"just-capitalize": "^3.2.0",
"just-clone": "^6.2.0",
"just-compare": "^2.3.0",
"just-random-integer": "^4.2.0",
"just-shuffle": "^4.2.0",
"kysely": "^0.27.4",
"lru-cache": "^11.0.0",
"markdown-to-jsx": "^7.5.0",
"nanoid": "^5.0.7",
"node-cron": "3.0.3",
"nprogress": "^0.2.0",
"openskill": "^4.0.3",
"react": "^18.3.1",
"react-charts": "^3.0.0-beta.57",
"react-dom": "^18.3.1",
"react-flip-toolkit": "7.2.4",
"react-hook-form": "^7.53.0",
"react-i18next": "^15.0.1",
"react-popper": "^2.3.0",
"react-responsive-masonry": "2.2.0",
"react-use": "^17.5.1",
"react-use-draggable-scroll": "^0.4.7",
"reconnecting-websocket": "^4.4.0",
"remix-auth": "^3.7.0",
"remix-auth-oauth2": "^1.11.2",
"remix-i18next": "^6.3.0",
"remix-utils": "^7.6.0",
"slugify": "^1.6.6",
"swr": "^2.2.5",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@playwright/test": "^1.46.1",
"@remix-run/dev": "^2.11.2",
"@types/better-sqlite3": "^7.6.11",
"@types/bun": "^1.1.8",
"@types/node-cron": "^3.0.11",
"@types/nprogress": "^0.2.3",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@types/react-responsive-masonry": "^2.1.3",
"ley": "^0.8.1",
"prettier": "3.3.3",
"sql-formatter": "^15.4.0",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite-tsconfig-paths": "^5.0.1"
},
"trustedDependencies": [
"@biomejs/biome",
"@swc/core",
"aws-sdk",
"better-sqlite3",
"core-js",
"esbuild",
"protobufjs"
]
"name": "sendou.ink",
"version": "3.0.0",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"deploy": "bun install --frozen-lockfile && bun run build",
"build": "remix vite:build",
"dev": "remix vite:dev --host",
"dev:prod": "DB_PATH=db-prod.sqlite3 bun run dev",
"dev:ci": "cp .env.example .env && bun run migrate up && bun run dev",
"start": "npm run migrate up && remix-serve ./build/server/index.js",
"migrate": "ley",
"migrate:reset": "bun scripts/delete-db-files.mjs && bun run migrate up",
"check-translation-jsons": "bun scripts/check-translation-jsons.ts",
"check-translation-jsons:no-write": "bun scripts/check-translation-jsons.ts --no-write",
"refresh-prod-db": "bun scripts/refresh-prod-db.ts && DB_PATH=db-prod.sqlite3 bun migrate up",
"biome:check": "bunx @biomejs/biome check .",
"biome:fix": "bunx @biomejs/biome check --write .",
"biome:fix:unsafe": "bunx @biomejs/biome check --write --unsafe .",
"typecheck": "tsc --noEmit",
"test:unit": "NODE_ENV=test bun test",
"test:unit:all": "bun test:unit app",
"test:e2e": "bunx playwright test",
"cf": "bun run biome:fix && bun run test:unit:all && bun run check-translation-jsons && bun run typecheck && bun run test:e2e",
"cf:noe2e": "bun run biome:fix && bun run test:unit:all && bun run check-translation-jsons && bun run typecheck"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.637.0",
"@aws-sdk/lib-storage": "^3.637.0",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@epic-web/cachified": "^5.2.0",
"@faker-js/faker": "^8.4.1",
"@headlessui/react": "^1.7.19",
"@hookform/resolvers": "^3.9.0",
"@popperjs/core": "^2.11.8",
"@remix-run/node": "^2.11.2",
"@remix-run/react": "^2.11.2",
"@remix-run/serve": "^2.11.2",
"@tldraw/tldraw": "2.3.0",
"aws-sdk": "^2.1682.0",
"better-sqlite3": "^11.2.1",
"clsx": "^2.1.1",
"compressorjs": "^1.2.1",
"countries-list": "^3.1.1",
"date-fns": "^3.6.0",
"fuse.js": "^7.0.0",
"gray-matter": "^4.0.3",
"i18next": "^23.14.0",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-http-backend": "^2.6.1",
"isbot": "^5.1.17",
"just-camel-case": "^6.2.0",
"just-capitalize": "^3.2.0",
"just-clone": "^6.2.0",
"just-compare": "^2.3.0",
"just-random-integer": "^4.2.0",
"just-shuffle": "^4.2.0",
"kysely": "^0.27.4",
"lru-cache": "^11.0.0",
"markdown-to-jsx": "^7.5.0",
"nanoid": "^5.0.7",
"node-cron": "3.0.3",
"nprogress": "^0.2.0",
"openskill": "^4.0.3",
"react": "^18.3.1",
"react-charts": "^3.0.0-beta.57",
"react-dom": "^18.3.1",
"react-flip-toolkit": "7.2.4",
"react-hook-form": "^7.53.0",
"react-i18next": "^15.0.1",
"react-popper": "^2.3.0",
"react-responsive-masonry": "2.2.0",
"react-use": "^17.5.1",
"react-use-draggable-scroll": "^0.4.7",
"reconnecting-websocket": "^4.4.0",
"remix-auth": "^3.7.0",
"remix-auth-oauth2": "^2.3.0",
"remix-i18next": "^6.3.0",
"remix-utils": "^7.6.0",
"slugify": "^1.6.6",
"swr": "^2.2.5",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@playwright/test": "^1.46.1",
"@remix-run/dev": "^2.11.2",
"@types/better-sqlite3": "^7.6.11",
"@types/bun": "^1.1.8",
"@types/node-cron": "^3.0.11",
"@types/nprogress": "^0.2.3",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@types/react-responsive-masonry": "^2.1.3",
"ley": "^0.8.1",
"prettier": "3.3.3",
"sql-formatter": "^15.4.0",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite-tsconfig-paths": "^5.0.1"
},
"trustedDependencies": [
"@biomejs/biome",
"@swc/core",
"aws-sdk",
"better-sqlite3",
"core-js",
"esbuild",
"protobufjs"
]
}

0 comments on commit 963e793

Please sign in to comment.