Skip to content

Commit

Permalink
Fix API
Browse files Browse the repository at this point in the history
  • Loading branch information
otiai10 committed Nov 15, 2024
1 parent 54f8b50 commit b877fa8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module.exports = (phase, { defaultConfig }) => {
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: process.env.NODE_ENV == "production" ? "export" : undefined,
distDir: "dest",
images: {
loader: 'custom',
domains: [
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"name": "hub",
"version": "1.0.1",
"engines": {
"node": "20.15.1",
"npm": "10.7.0"
"node": "20",
"pnpm": "9"
},
"description": "",
"main": "index.js",
"scripts": {
"test": "jest",
"test": "vitest",
"dev": "next dev ./client",
"build": "next build ./client",
"export": "NODE_ENV=production next build ./client && next export ./client -o ./client/dest",
"export": "NODE_ENV=production next build ./client",
"lint": "next lint ./client"
},
"repository": {
Expand Down Expand Up @@ -42,7 +42,9 @@
"react-test-renderer": "^18.3.1",
"sass": "^1.38.0",
"tailwindcss": "^3.0.15",
"typescript": "^4.3.5"
"too": "^3.0.1",
"typescript": "^4.3.5",
"vitest": "^2.1.5"
},
"dependencies": {
"@headlessui/react": "^1.4.0",
Expand Down
6 changes: 4 additions & 2 deletions server/filters/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ func (auth *Auth) Handle(next http.Handler) http.Handler {
if err != nil {
panic(err)
}
defer f.Close()
myself := models.Myself{}
json.NewDecoder(f).Decode(&myself)
f.Close()
if err = json.NewDecoder(f).Decode(&myself); err != nil {
panic(err)
}
next.ServeHTTP(w, SetSessionUserContext(req, myself.OpenID.Sub))
return
}
Expand Down

0 comments on commit b877fa8

Please sign in to comment.