mirror of
https://github.com/diced/zipline.git
synced 2025-05-12 10:56:01 +02:00
fix: nullable oauthId (#734)
This commit is contained in:
parent
a3aa1302e1
commit
ab8c6a708a
3 changed files with 2 additions and 15 deletions
|
@ -41,10 +41,6 @@ export default function Export3Details({ export3 }: { export3: Export3 }) {
|
||||||
const [envOpened, { toggle: toggleEnv }] = useDisclosure(false);
|
const [envOpened, { toggle: toggleEnv }] = useDisclosure(false);
|
||||||
const [osOpened, { toggle: toggleOs }] = useDisclosure(false);
|
const [osOpened, { toggle: toggleOs }] = useDisclosure(false);
|
||||||
|
|
||||||
const lastStat = export3.stats.sort(
|
|
||||||
(a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime(),
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
const envRows = Object.entries(export3.request.env).map(([key, value]) => (
|
const envRows = Object.entries(export3.request.env).map(([key, value]) => (
|
||||||
<Table.Tr key={key}>
|
<Table.Tr key={key}>
|
||||||
<Table.Td>{key}</Table.Td>
|
<Table.Td>{key}</Table.Td>
|
||||||
|
@ -333,15 +329,6 @@ export default function Export3Details({ export3 }: { export3: Export3 }) {
|
||||||
/>
|
/>
|
||||||
</Accordion.Panel>
|
</Accordion.Panel>
|
||||||
</Accordion.Item>
|
</Accordion.Item>
|
||||||
|
|
||||||
<Accordion.Item value='Stats'>
|
|
||||||
<Accordion.Control icon={<IconGraph size='1rem' />}>Stats</Accordion.Control>
|
|
||||||
<Accordion.Panel>
|
|
||||||
There was a total of {export3.stats.length} stats entries. The last one recorded at{' '}
|
|
||||||
{new Date(lastStat.created_at).toLocaleString()} with the following data:
|
|
||||||
<HighlightCode language='json' code={JSON.stringify(lastStat.data, null, 2)} />
|
|
||||||
</Accordion.Panel>
|
|
||||||
</Accordion.Item>
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -195,7 +195,7 @@ export const export3Schema = z.object({
|
||||||
z.object({
|
z.object({
|
||||||
provider: z.union([z.literal('DISCORD'), z.literal('GITHUB'), z.literal('GOOGLE')]),
|
provider: z.union([z.literal('DISCORD'), z.literal('GITHUB'), z.literal('GOOGLE')]),
|
||||||
username: z.string(),
|
username: z.string(),
|
||||||
oauth_id: z.string(),
|
oauth_id: z.string().nullable(),
|
||||||
access_token: z.string().nullable(),
|
access_token: z.string().nullable(),
|
||||||
refresh_token: z.string().nullable(),
|
refresh_token: z.string().nullable(),
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -104,7 +104,7 @@ export default fastifyPlugin(
|
||||||
provider: provider.provider as any,
|
provider: provider.provider as any,
|
||||||
accessToken: provider.access_token!,
|
accessToken: provider.access_token!,
|
||||||
refreshToken: provider.refresh_token ?? null,
|
refreshToken: provider.refresh_token ?? null,
|
||||||
oauthId: provider.oauth_id!,
|
oauthId: provider.oauth_id ?? null,
|
||||||
username: provider.username!,
|
username: provider.username!,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue