Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(authentication): pin [email protected] to top of dev login list (#68205)

Luke Belton6c1a0c540693
diff --git a/frontend/src/scenes/authentication/shared/devLoginLogic.ts b/frontend/src/scenes/authentication/shared/devLoginLogic.ts
index bff039cf5c4e..20b0a7bb61ca 100644
--- a/frontend/src/scenes/authentication/shared/devLoginLogic.ts
+++ b/frontend/src/scenes/authentication/shared/devLoginLogic.ts
@@ -13,6 +13,8 @@ export interface DevUser {
export const DEV_LOGIN_SECONDS_SAVED_PER_CLICK = 5
+export const DEV_LOGIN_DEFAULT_EMAIL = '[email protected]'
+
export const devLoginLogic = kea<devLoginLogicType>([
path(['scenes', 'authentication', 'shared', 'devLoginLogic']),
actions({
@@ -36,7 +38,13 @@ export const devLoginLogic = kea<devLoginLogicType>([
breakpoint()
try {
const response = await api.get<{ users: DevUser[] }>('api/login/dev')
- return response.users
+ // Pin the default seeded user to the top; the rest keep the backend's alphabetical order.
+ const users = [...response.users]
+ const defaultIndex = users.findIndex((u) => u.email === DEV_LOGIN_DEFAULT_EMAIL)
+ if (defaultIndex > 0) {
+ users.unshift(...users.splice(defaultIndex, 1))
+ }
+ return users
} catch {
// Endpoint is unavailable unless allow_dev_login is set in preflight.
return []