Skip to content

Commit

Permalink
fix TS and build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tylersai committed Oct 29, 2024
1 parent d914d88 commit d319686
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@
"eslint": "8.7.0",
"eslint-config-next": "12.0.9",
"typescript": "^4.5.5"
},
"resolutions": {
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2"
}
}
2 changes: 1 addition & 1 deletion pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default NextAuth({
},

session: async function session({ session, token }) {
session.accessToken = token.accessToken;
session.accessToken = token.accessToken as string;
try {
const { data } = await axios.get(getFullUrlOrThrow("/website/auth/user/profile"), {
headers: {
Expand Down
11 changes: 11 additions & 0 deletions types/next-auth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import NextAuth from "next-auth";

declare module "next-auth" {
interface Session {
accessToken?: string;
}
interface User {
accessToken?: string;
refreshToken?: string;
}
}
16 changes: 11 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,19 @@
resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz"
integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==

"@types/react@*":
version "18.0.8"
resolved "https://registry.npmjs.org/@types/react/-/react-18.0.8.tgz"
integrity sha512-+j2hk9BzCOrrOSJASi5XiOyBbERk9jG5O73Ya4M0env5Ixi6vUNli4qy994AINcEF+1IEHISYFfIT4zwr++LKw==
"@types/[email protected]":
version "17.0.2"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.2.tgz#35654cf6c49ae162d5bc90843d5437dc38008d43"
integrity sha512-Icd9KEgdnFfJs39KyRyr0jQ7EKhq8U6CcHRMGAS45fp5qgUvxL3ujUCfWFttUK2UErqZNj97t9gsVPNAqcwoCg==
dependencies:
"@types/react" "*"

"@types/react@*", "@types/[email protected]":
version "17.0.2"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.2.tgz#3de24c4efef902dd9795a49c75f760cbe4f7a5a8"
integrity sha512-Xt40xQsrkdvjn1EyWe1Bc0dJLcil/9x2vAuW7ya+PuQip4UYUaXyhzWmAbwRsdMgwOFHpfp7/FFZebDU6Y8VHA==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/[email protected]":
Expand Down

0 comments on commit d319686

Please sign in to comment.