mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
updated every file for database changes; starting scheduling debugging
This commit is contained in:
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useAuth } from '../../contexts/AuthContext';
|
||||
import { useNotification } from '../../contexts/NotificationContext';
|
||||
import { employeeService } from '../../services/employeeService';
|
||||
|
||||
const Login: React.FC = () => {
|
||||
const [email, setEmail] = useState('');
|
||||
@@ -12,7 +13,6 @@ const Login: React.FC = () => {
|
||||
const { showNotification } = useNotification();
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 🔥 NEU: Redirect wenn bereits eingeloggt
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
console.log('✅ User already logged in, redirecting to dashboard');
|
||||
@@ -27,8 +27,7 @@ const Login: React.FC = () => {
|
||||
try {
|
||||
console.log('🔐 Attempting login for:', email);
|
||||
await login({ email, password });
|
||||
|
||||
// 🔥 WICHTIG: Erfolgsmeldung und Redirect
|
||||
|
||||
console.log('✅ Login successful, redirecting to dashboard');
|
||||
showNotification({
|
||||
type: 'success',
|
||||
|
||||
Reference in New Issue
Block a user