mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-04 15:04:43 +00:00
17 lines
449 B
TypeScript
17 lines
449 B
TypeScript
import { ACCESS_TOKEN_COOKIE_NAME } from '$lib/constants';
|
|
import ApiKeyService from '$lib/services/api-key-service';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
export const load: PageServerLoad = async ({ cookies }) => {
|
|
const apiKeyService = new ApiKeyService(cookies.get(ACCESS_TOKEN_COOKIE_NAME));
|
|
|
|
const apiKeys = await apiKeyService.list({
|
|
sort: {
|
|
column: 'lastUsedAt',
|
|
direction: 'desc' as const
|
|
}
|
|
});
|
|
|
|
return apiKeys;
|
|
};
|