API reference

useAuthStore

The session store: user, login, logout and the demo role.

stores/auth.ts

Pinia stores use the Composition API and are auto-imported. The session is the auth-session cookie, so it works on the server.

useAuthStore()

Returns user, isAuthenticated, fullname, welcomeMessage, isDemoRole, login(email, remember), logout() and setDemoRole(id).

stores/auth.ts
const useAuthStore: SetupStoreDefinition<"auth", { user: any; isDemoRole: any; isAuthenticated: any; fullname: any; welcomeMessage: any; login: (email: string, remember?: boolean) => void; logout: ()…

AUTH_HOME_ROUTE

Where users land after signing in.

stores/auth.ts
const AUTH_HOME_ROUTE: "/dashboard/analytics"

AUTH_LOGIN_ROUTE

The login route guests are sent to.

stores/auth.ts
const AUTH_LOGIN_ROUTE: "/login"

The session cookie name.

stores/auth.ts
const AUTH_COOKIE_KEY: "auth-session"

The demo role cookie name.

stores/auth.ts
const AUTH_ROLE_COOKIE_KEY: "auth-demo-role"
© 2026 melsami UI.
Developer documentation for melsami UI.