Add shared empty states, customer product filters, and SSO handoff across dashboards.
Standardize list empty UI, searchable country fields, customer-products filter row, password/login polish, and one-time business dashboard handoff from the customer app. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
832ac32a09
commit
f8a9a28346
@@ -18,6 +18,7 @@ import {
|
||||
loginWithOtp as loginWithOtpRequest,
|
||||
logout as logoutRequest,
|
||||
} from '../services/authService'
|
||||
import { completeHandoffIfPresent } from '../lib/handoff'
|
||||
import { resolveTenantByDomain } from '../services/tenantService'
|
||||
import type { AuthUser } from '../types/auth'
|
||||
|
||||
@@ -93,12 +94,21 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
const controller = new AbortController()
|
||||
|
||||
async function init() {
|
||||
if (!getAccessToken()) {
|
||||
if (!controller.signal.aborted) setIsLoading(false)
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const handedOff = await completeHandoffIfPresent()
|
||||
if (controller.signal.aborted) return
|
||||
|
||||
if (handedOff) {
|
||||
await assertBusinessAccess(handedOff.user)
|
||||
if (controller.signal.aborted) return
|
||||
setUser(handedOff.user)
|
||||
return
|
||||
}
|
||||
|
||||
if (!getAccessToken()) {
|
||||
return
|
||||
}
|
||||
|
||||
const { user: currentUser } = await fetchCurrentUser(controller.signal)
|
||||
if (controller.signal.aborted) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user