mirror of
https://github.com/arkorty/Reduce.git
synced 2026-03-18 00:47:10 +00:00
fix: patch version 2.1
This commit is contained in:
8
backend/.gitignore
vendored
8
backend/.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
# Go
|
|
||||||
bin/
|
bin/
|
||||||
|
data/
|
||||||
pkg/
|
pkg/
|
||||||
*.exe
|
*.exe
|
||||||
*.dll
|
*.dll
|
||||||
@@ -7,9 +7,3 @@ pkg/
|
|||||||
*.test
|
*.test
|
||||||
*.prof
|
*.prof
|
||||||
.env
|
.env
|
||||||
|
|
||||||
# Database
|
|
||||||
reduce.db*
|
|
||||||
|
|
||||||
# Binary
|
|
||||||
reduce
|
|
||||||
29
backend/Makefile
Normal file
29
backend/Makefile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
.PHONY: build run clean fmt install
|
||||||
|
|
||||||
|
# Build the Go application
|
||||||
|
build:
|
||||||
|
GOOS=linux \
|
||||||
|
GOARCH=amd64 \
|
||||||
|
CGO_ENABLED=1 \
|
||||||
|
CC=x86_64-unknown-linux-gnu-gcc \
|
||||||
|
CGO_CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE" \
|
||||||
|
go build -ldflags="-s -w" -o bin/reduce .
|
||||||
|
|
||||||
|
# Run the application
|
||||||
|
run:
|
||||||
|
go run .
|
||||||
|
|
||||||
|
# Clean build artifacts
|
||||||
|
clean:
|
||||||
|
rm -rf bin/
|
||||||
|
|
||||||
|
# Format code
|
||||||
|
fmt:
|
||||||
|
go fmt ./...
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
install:
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
# Default target
|
||||||
|
all: clean install build
|
||||||
@@ -187,6 +187,7 @@ func login(c echo.Context) error {
|
|||||||
|
|
||||||
// Set httpOnly cookie
|
// Set httpOnly cookie
|
||||||
cookie := &http.Cookie{
|
cookie := &http.Cookie{
|
||||||
|
Domain: os.Getenv("COOKIE_DOMAIN"),
|
||||||
Name: "token",
|
Name: "token",
|
||||||
Value: token,
|
Value: token,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
@@ -210,6 +211,7 @@ func logout(c echo.Context) error {
|
|||||||
Path: "/",
|
Path: "/",
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
MaxAge: -1, // Delete cookie
|
MaxAge: -1, // Delete cookie
|
||||||
|
Domain: os.Getenv("COOKIE_DOMAIN"),
|
||||||
}
|
}
|
||||||
c.SetCookie(cookie)
|
c.SetCookie(cookie)
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ export default function User() {
|
|||||||
setUpdatingUsername(true);
|
setUpdatingUsername(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.put('/user/username', { username: newUsername });
|
|
||||||
setSuccess('Username updated successfully');
|
setSuccess('Username updated successfully');
|
||||||
// Update the user in context would require refetching /auth/me
|
// Update the user in context would require refetching /auth/me
|
||||||
window.location.reload(); // Simple way to update context
|
window.location.reload(); // Simple way to update context
|
||||||
|
|||||||
Reference in New Issue
Block a user