Automatically logs in a user if valid data is found in localStorage.
Searches for both "user" and "rememberMe" entries.
Fetches all user profiles from the backend.
Observable of user profile data.
Initiates a password reset email for the specified address.
User email for password reset.
Observable of the backend response.
Retrieves the current user from localStorage (if available).
The user object or null if not logged in.
Returns the current user's authentication token.
JWT token string or an empty string if not logged in.
Checks if a user session is currently active.
true if a user is logged in, otherwise false.
Loads the user from localStorage into the reactive signal state.
Loads all registered user emails from the backend. Used mainly for async email validation during signup and forgot-password flows.
Observable stream of users.
Logs in a user with the provided credentials.
User's email address.
User's password.
Observable emitting a User object on success.
Logs the user out, clears session data, and redirects to the login page.
Completes the password reset process with provided credentials.
User ID from reset link.
Reset token.
The new password to set.
Observable of the backend response.
Persists user data to both signal state and localStorage.
User object to store.
Registers a new user.
User email.
User password.
Confirmation password.
Observable emitting a new User on success.
Updates the user's list of favorite videos both locally and in storage.
Array of favorite video IDs.
Authentication service.
Manages all authentication and user-related operations such as:
localStorageAll API calls are handled through Angular's
HttpClientwith error handling delegated toErrorService.