Merge branch 'main' into auth

This commit is contained in:
Nathaniel Tampus
2023-03-20 18:53:35 +08:00
committed by GitHub
8 changed files with 12 additions and 5 deletions

3
client/public/robots.txt Normal file
View File

@@ -0,0 +1,3 @@
User-Agent: *
Allow: /$
Disallow: /

View File

@@ -30,6 +30,7 @@ export default function ThemeToggle() {
return (
<button
type="button"
aria-label="Toggle theme"
onClick={() => changeTheme(darkTheme ? "light" : "dark")}
className={"btn btn-ghost btn-circle swap swap-rotate" + (darkTheme ? " swap-active" : "")}
>

View File

@@ -52,7 +52,9 @@ export default function CreateGame() {
</select>
<button
className={
"btn" + (buttonLoading ? " loading" : "") + (!session?.user?.id ? " btn-disabled" : "")
"btn" +
(buttonLoading ? " loading" : "") +
(!session?.user?.id ? " btn-disabled text-base-content" : "")
}
type="submit"
>

View File

@@ -57,7 +57,7 @@ export default function JoinGame() {
className={
"btn btn-square" +
(buttonLoading ? " loading" : "") +
(!session?.user?.id ? " btn-disabled" : "")
(!session?.user?.id ? " btn-disabled text-base-content" : "")
}
type="submit"
>

View File

@@ -16,6 +16,7 @@ export default function RefreshButton() {
return (
<button
aria-label="Refresh public games"
className={"btn btn-sm btn-ghost" + (isLoading ? " loading" : "")}
onClick={handleRefresh}
>

View File

@@ -19,7 +19,7 @@
"eslint": "^8.36.0",
"eslint-config-next": "13.2.4",
"eslint-config-prettier": "^8.7.0",
"prettier": "^2.8.4",
"prettier": "^2.8.5",
"prettier-plugin-tailwindcss": "^0.2.5"
},
"engines": {

View File

@@ -25,7 +25,7 @@
"@chessu/types": "*",
"@types/connect-pg-simple": "^7.0.0",
"@types/express": "^4.17.17",
"@types/express-session": "^1.17.6",
"@types/express-session": "^1.17.7",
"@types/node": "^18.15.3",
"@types/pg": "^8.6.6",
"ts-node": "^10.9.1",

View File

@@ -12,7 +12,7 @@ export const getCurrentSession = async (req: Request, res: Response) => {
if (req.session.user) {
res.status(200).json(req.session.user);
} else {
res.status(404).end();
res.status(204).end();
}
} catch (err: unknown) {
console.log(err);