Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ services:
- NEXT_PUBLIC_IMAGE_URL=http://localhost:8000
- NEXT_PUBLIC_API_TOKEN=${NEXT_PUBLIC_API_TOKEN}
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
- NEXT_PUBLIC_JWT_SECRET=${NEXT_PUBLIC_JWT_SECRET}
- JWT_SECRET=${JWT_SECRET}
- API_URL=${API_URL}
- NODE_ENV=development
env_file:
Expand Down
6 changes: 3 additions & 3 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ ENV NEXT_PUBLIC_JWT_SECRET=${NEXT_PUBLIC_JWT_SECRET}
ARG JWT_SECRET
ENV JWT_SECRET=${JWT_SECRET}

CMD npm run dev
# CMD npm run dev

# RUN npm run build
# CMD npm run start
RUN npm run build
CMD npm run start

# RUN if [ "$NODE_ENV" = "production" ]; then npm run build; fi
# CMD if [ "$NODE_ENV" = "production" ]; then npm run start; else npm run dev; fi
3 changes: 2 additions & 1 deletion frontend/src/context/UserContext/UserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export const UserProvider = ({ children }: { children: ReactNode }) => {
const [user, setUser] = useState<GetMeQuery["me"] | null>(null);

useEffect(() => {
console.log("data", data)
console.log("data", data);

if (data?.me) {
setUser(data.me);
} else {
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/pages/admin/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const LoginPage = (): React.ReactElement => {
const handleLogin = async (e: FormEvent) => {
e.preventDefault();

console.log("varible NEXT_PUBLIC_JWT_SECRET -->", process.env.NEXT_PUBLIC_JWT_SECRET);

try {
const res = await login({
variables: {
Expand All @@ -57,16 +59,16 @@ const LoginPage = (): React.ReactElement => {
const response = res.data?.login;

if (response?.code === 200) {
// console.log("✅ Connexion réussie :", response.message);
console.log("✅ Connexion réussie :", response.message);
showAlert("success", translations.messagePageLoginMessageSuccess);
} else if (response?.code === 401) {
// console.warn("❌ Identifiants invalides :", response.message);
console.warn("❌ Identifiants invalides :", response.message);
showAlert("error", translations.messagePageLoginMessageErrorServer);
} else if (response?.code === 500) {
// console.error("❌ Erreur serveur :", response.message);
console.error("❌ Erreur serveur :", response.message);
showAlert("error", translations.messagePageLoginMessageErrorUnexpected);
} else {
// console.warn("⚠️ Autre erreur :", response?.message);
console.warn("⚠️ Autre erreur :", response?.message);
showAlert("error", translations.messagePageLoginMessageErrorServer);
}
} catch (err) {
Expand Down