- Added `AssignCoursesModal`, `AudienceMemberRow`, `AudienceTable`, and related components for improved audience management UI. - Implemented audience invite actions including resend and revoke functionality. - Updated audience API to support importing members and assigning courses. - Refactored audience data handling to include status and invite management. - Improved overall user experience with pagination and selection features in the audience table.
25 lines
789 B
TypeScript
25 lines
789 B
TypeScript
import type { Cookies } from '@sveltejs/kit';
|
|
|
|
/**
|
|
* Returns the classroomio cookie string for API/auth requests.
|
|
* Filters cookies whose names include "classroomio" and joins them as `name=value; ...`.
|
|
*/
|
|
export function getCioCookieString(cookies: Cookies): string {
|
|
return cookies
|
|
.getAll()
|
|
.filter((c) => c.name.includes('classroomio'))
|
|
.map((c) => `${c.name}=${c.value}`)
|
|
.join('; ');
|
|
}
|
|
|
|
export function getHasCioCookies(cookies: Cookies): boolean {
|
|
const cioCookies = cookies.getAll().filter((c) => c.name.includes('classroomio'));
|
|
|
|
if (cioCookies.length === 0) return false;
|
|
|
|
// check if the cookies doesn't includ ONLY classroomio_locale
|
|
const onlyLocaleCookie = cioCookies.every((c) => c.name === 'classroomio_locale');
|
|
|
|
return !onlyLocaleCookie;
|
|
}
|