Authentication Events
Authentication events track the Mimeeq login system — from component initialization through login, signup, profile management, and logout. These events come from the <mmq-auth> web component, which provides the full authentication UI (login form, signup, forgot password, user profile).
For setup and component API details, see the <mmq-auth> Component Reference.
Authentication Flow
<mmq-auth> component loads
│
▼
mimeeq-auth-loaded ← auth service ready, safe to call methods
│
▼
┌─── User action ────────────────────────────────────────────┐
│ │
│ Login flow: │
│ mimeeq-enter-login ──► (user submits) ──► mimeeq-login-success
│ │ │ │
│ └── mimeeq-leave-login (if closed) │ │
│ ▼ │
│ mimeeq-user-signed-in
│ │
│ Forgot Password flow: │
│ mimeeq-enter-forgot-password ──► (user resets password) │
│ │ │ │
│ └── mimeeq-leave-forgot-password│ │
│ ▼ │
│ mimeeq-login-success │
│ (if auto-login after reset) │
│ │
│ Signup flow: │
│ mimeeq-enter-sign-up ──► (user submits) ──► mimeeq-sign-up-success
│ │ │
│ └── mimeeq-leave-sign-up (if closed) │
│ │
│ Profile: │
│ mimeeq-enter-profile ──► (user edits) ──► mimeeq-user-updated
│ │ │
│ └── mimeeq-leave-profile (if closed) │
│ │
│ Logout: │
│ mimeeq-logout-success ──► mimeeq-user-signed-out │
│ │
│ Account deletion: │
│ mimeeq-user-deleted (Tier 2 users only) │
└─────────────────────────────────────────────────────────────┘
There are two sets of navigation events. The enter-/leave- events fire when forms are shown and hidden within the auth component's navigation (e.g., switching from login to forgot password). The -closed events (mimeeq-login-closed, mimeeq-profile-closed, mimeeq-forgot-password-closed) fire when the modal itself is dismissed. In practice, you'll usually care about the -closed events for UI cleanup and the enter-/leave- events for analytics.
Events
mimeeq-auth-loaded
The <mmq-auth> component has loaded and the authentication service is initialized. This is the earliest safe point to call methods like mountLogin(), mountUserProfile(), or mountForgotPassword().
This event fires once per page when the auth library finishes loading. It does not indicate whether a user is currently logged in — use the auth API to check session state.
Payload: none
document.addEventListener('mimeeq-auth-loaded', () => {
const auth = document.querySelector('mmq-auth');
// Check if user is logged in and update UI accordingly
window.mimeeqAuth.authorization.getUserData().then((userData) => {
if (userData) {
document.getElementById('login-btn').style.display = 'none';
document.getElementById('user-name').textContent = userData.firstName;
document.getElementById('user-menu').style.display = 'block';
} else {
document.getElementById('login-btn').style.display = 'block';
document.getElementById('user-menu').style.display = 'none';
}
});
});
Like mimeeq-app-loaded, the auth component may have already loaded by the time your script runs. There is no window.mimeeqAuthLoaded flag, so wrap your initialization in a check:
function onAuthReady(callback) {
if (window.mimeeqAuth) {
callback();
} else {
document.addEventListener('mimeeq-auth-loaded', callback, { once: true });
}
}
mimeeq-login-success
A user has successfully logged in through the Mimeeq login form. The payload contains the authenticated user's profile data. This fires both from the normal login flow and when a user completes a password reset that auto-logs them in.
After this event, Mimeeq's internal state updates: pricing may change to reflect the user's company, favourites become available, and the basket may load saved items.
Payload: LoginSuccessEventPayload
| Field | Type | Description |
|---|---|---|
firstName | string | User's first name |
lastName | string | User's last name |
email | string | User's email address |
document.addEventListener('mimeeq-login-success', (event) => {
const { firstName, lastName, email } = event.detail;
// Update your site's header
document.getElementById('login-btn').style.display = 'none';
document.getElementById('user-name').textContent = `${firstName} ${lastName}`;
document.getElementById('user-menu').style.display = 'block';
// Sync with your own auth system if needed
syncExternalAuth(email);
analytics.track('login_success', { email });
});
mimeeq-sign-up-success
A new user account was created successfully. The payload contains the new user's profile data. Note that signing up does not automatically log the user in — they may need to verify their email first depending on the tenant configuration.
Payload: SignUpSuccessEventPayload
| Field | Type | Description |
|---|---|---|
firstName | string | User's first name |
lastName | string | User's last name |
email | string | User's email address |
document.addEventListener('mimeeq-sign-up-success', (event) => {
const { email } = event.detail;
analytics.track('signup_success', { email });
showNotification('Account created! Check your email to verify.');
});
mimeeq-logout-success
The user has logged out. Mimeeq's internal state resets: pricing reverts to public/anonymous, favourites become unavailable, and the session is cleared.
Payload: none
document.addEventListener('mimeeq-logout-success', () => {
// Revert UI to anonymous state
document.getElementById('user-menu').style.display = 'none';
document.getElementById('login-btn').style.display = 'block';
// Clear any cached user-specific data
clearUserCache();
analytics.track('logout');
});
mimeeq-user-signed-in
Fires after a user session is established. This is a lower-level companion to mimeeq-login-success — it fires in the same scenarios but is dispatched from the session layer rather than the UI layer.
Payload: UserSignedInEventPayload
| Field | Type | Description |
|---|---|---|
firstName | string | User's first name |
lastName | string | User's last name |
email | string | User's email address |
mimeeq-user-signed-out
Fires after the user session is destroyed. This is the session-layer companion to mimeeq-logout-success.
Payload: none
mimeeq-user-updated
The user updated their profile information (name, email, password, etc.) through the profile form.
Payload: none
mimeeq-user-deleted
A Tier 2 (partner/client) user deleted their own account. This is only available for Tier 2 users — Tier 1 (customers) users cannot self-delete. After this event, the session is destroyed and the user is treated as anonymous.
Payload: none
mimeeq-resend-signup-confirm-code
A signup verification code was resent to the user's email. This fires when the user requests a new code during the email verification step of the signup flow.
Payload: ResendSignupConfirmCodeEventPayload
| Field | Type | Description |
|---|---|---|
email | string | Email address the verification code was sent to |
Navigation Events
These events track which auth form is currently displayed. They fire in pairs: enter- when a form appears, leave- when it's hidden (either by navigating to another form or by closing the modal).
| Event | Description |
|---|---|
mimeeq-enter-login | Login form shown |
mimeeq-leave-login | Login form hidden (navigated away or modal closed) |
mimeeq-enter-forgot-password | Forgot Password form shown |
mimeeq-leave-forgot-password | Forgot Password form hidden |
mimeeq-enter-sign-up | Sign Up form shown |
mimeeq-leave-sign-up | Sign Up form hidden |
mimeeq-enter-profile | User Profile shown |
mimeeq-leave-profile | User Profile hidden |
None of these carry a payload.
// Track which auth forms users visit
const authForms = [
'mimeeq-enter-login',
'mimeeq-enter-forgot-password',
'mimeeq-enter-sign-up',
'mimeeq-enter-profile',
];
authForms.forEach((eventName) => {
document.addEventListener(eventName, () => {
const form = eventName.replace('mimeeq-enter-', '');
analytics.track('auth_form_viewed', { form });
});
});
Modal Closed Events
These fire when the auth modal itself is dismissed (X button, click outside, escape key), as opposed to the leave- events which fire during internal navigation.
| Event | Description |
|---|---|
mimeeq-login-closed | Login modal dismissed |
mimeeq-profile-closed | User Profile modal dismissed |
mimeeq-forgot-password-closed | Forgot Password modal dismissed |
None carry a payload.
Pricing Context Events
These events fire when a logged-in user changes the pricing context — either by switching companies or changing the price type. They affect which prices are displayed in the configurator and are relevant for integrations that show prices outside the Mimeeq embed.
mimeeq-select-company
The user changed the active company in the price selector. This is relevant for Tier 1 users who have access to multiple company price lists, or Tier 2 users assigned to companies with specific pricing.
Fires in both standard and modular configurators.
Payload: SelectCompanyEventPayload
| Field | Type | Description |
|---|---|---|
companyName | string | Display name of the selected company |
companyId | string | Unique identifier of the selected company |
document.addEventListener('mimeeq-select-company', (event) => {
const { companyName, companyId } = event.detail;
// Update external price displays or fetch company-specific data
updatePricingContext(companyId);
analytics.track('company_changed', { companyName, companyId });
});
mimeeq-select-price-type
The user changed the price type in the price selector (e.g., switching between retail, wholesale, or custom price types configured in the admin panel).
Fires in both standard and modular configurators.
Payload: SelectPriceTypeEventPayload
| Field | Type | Description |
|---|---|---|
type | string | Price type identifier |
name | string | Display name of the price type |
id | string | Unique identifier of the price type |
document.addEventListener('mimeeq-select-price-type', (event) => {
const { name, id } = event.detail;
analytics.track('price_type_changed', { priceType: name, priceTypeId: id });
});
Related
<mmq-auth>Component Reference — component attributes, methods, and theming- Authentication Introduction — auth API overview
- Mimeeq Authentication: User Guide — business setup for
<mmq-auth>