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 ( return (
<button <button
type="button" type="button"
aria-label="Toggle theme"
onClick={() => changeTheme(darkTheme ? "light" : "dark")} onClick={() => changeTheme(darkTheme ? "light" : "dark")}
className={"btn btn-ghost btn-circle swap swap-rotate" + (darkTheme ? " swap-active" : "")} className={"btn btn-ghost btn-circle swap swap-rotate" + (darkTheme ? " swap-active" : "")}
> >

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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