feat(api): refactor API client usage across frontend components
- Replaced direct axios calls with a centralized apiClient in Register, Login, and Activate components for improved maintainability and consistency. - Updated backend base URL logic to support different environments, enhancing flexibility in API interactions. - Added console logging in the authController for better tracking of user registration flow.
This commit is contained in:
@@ -3,9 +3,12 @@ import { register, activateUser, login, logout } from '../services/authService.j
|
||||
const registerUser = async (req, res, next) => {
|
||||
try {
|
||||
const { email, password } = req.body;
|
||||
console.log('registerUser', email, password);
|
||||
await register(email, password);
|
||||
console.log('registerUser done');
|
||||
// Aus Sicherheitsgründen KEINE Userdaten (Passwort-Hash, Aktivierungscode, ...) zurückgeben
|
||||
res.status(201).json({ success: true });
|
||||
console.log('registerUser response sent');
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user