fix: resolve 9 failing tests across 5 suites
Some checks failed
homelab-k8s-services/tcb_devportal/pipeline/head There was a failure building this commit
Some checks failed
homelab-k8s-services/tcb_devportal/pipeline/head There was a failure building this commit
- headers: add blob: to connect-src (CSP regression) - scenario: rename SUCCESS → PASSED in SCENARIO_STATUS constant - auth.query-options: export authKeys.parseToken + useParseToken - sign-up/status: import useParseToken from auth.query-options so jest.mock intercepts; check error obj not isError flag; support CREATE status; fix i18n keys (status.create.title/description, btn.done)
This commit is contained in:
@@ -22,6 +22,8 @@ export const authKeys = {
|
||||
all: ['auth'] as const,
|
||||
verifyToken: (token?: string) =>
|
||||
[...authKeys.all, token, 'verifyToken'] as const,
|
||||
parseToken: (token: string) =>
|
||||
[...authKeys.all, token, 'parseToken'] as const,
|
||||
}
|
||||
|
||||
export function useVerifyToken(token: string) {
|
||||
@@ -32,6 +34,14 @@ export function useVerifyToken(token: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export function useParseToken(token: string) {
|
||||
return useQuery({
|
||||
queryKey: authKeys.parseToken(token),
|
||||
queryFn: () => authApi.parseToken(token),
|
||||
retry: false,
|
||||
})
|
||||
}
|
||||
|
||||
const clearAuthAndLogout = () => {
|
||||
localStorage.removeItem(AUTH_INFO_KEY)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user