diff --git a/front/app/install/steps/get_started.tsx b/front/app/install/steps/get_started.tsx index 980912da..f57a9931 100644 --- a/front/app/install/steps/get_started.tsx +++ b/front/app/install/steps/get_started.tsx @@ -9,20 +9,22 @@ function GetStarted() { const { data: install, error: error, isLoading } = useSWR(`${getAPIUrl()}install/latest`, swrFetcher); const router = useRouter() - function startInstallation() { - fetch(`${getAPIUrl()}install/start`, { + async function startInstallation() { + let res = await fetch(`${getAPIUrl()}install/start`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({}) - }).then(res => res.json()).then(res => { - if (res.success) { - mutate(`${getAPIUrl()}install/latest`) - router.push(`/install?step=1`) - } }) + if (res.status == 200) { + mutate(`${getAPIUrl()}install/latest`) + router.refresh(); + router.push(`/install?step=1`) + } + + } function redirectToStep() { diff --git a/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx index 5bb3ca38..0524577b 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx @@ -45,7 +45,7 @@ const CollectionsPage = async (params: any) => {
- + diff --git a/front/app/orgs/[orgslug]/(withmenu)/courses/courses.tsx b/front/app/orgs/[orgslug]/(withmenu)/courses/courses.tsx index 7b860abb..e1b57d4d 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/courses/courses.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/courses/courses.tsx @@ -20,6 +20,7 @@ import { getCourseThumbnailMediaDirectory } from '@services/media/media'; interface CourseProps { orgslug: string; courses: any; + org_id: string; } // function to remove "course_" from the course_id @@ -49,7 +50,7 @@ function Courses(props: CourseProps) {
- + {courses.map((course: any) => (
- +
diff --git a/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx index 027e7719..8b4e5371 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx @@ -25,13 +25,14 @@ export async function generateMetadata( const CoursesPage = async (params: any) => { const orgslug = params.params.orgslug; + const org = await getOrganizationContextInfo(orgslug, { revalidate: 1800, tags: ['organizations'] }); const cookieStore = cookies(); const access_token_cookie: any = cookieStore.get('access_token_cookie'); const courses = await getOrgCoursesWithAuthHeader(orgslug, { revalidate: 0, tags: ['courses'] }, access_token_cookie ? access_token_cookie.value : null); return (
- +
); }; diff --git a/front/components/Security/AuthenticatedClientElement.tsx b/front/components/Security/AuthenticatedClientElement.tsx index e46618bd..e43e41e6 100644 --- a/front/components/Security/AuthenticatedClientElement.tsx +++ b/front/components/Security/AuthenticatedClientElement.tsx @@ -14,7 +14,7 @@ export const AuthenticatedClientElement = (props: AuthenticatedClientElementProp // Available roles const org_roles_values = ["admin", "owner"]; - const user_roles_values = ["role_admin", "role_super_admin"]; + const user_roles_values = ["role_admin"]; @@ -24,7 +24,7 @@ export const AuthenticatedClientElement = (props: AuthenticatedClientElementProp const user_roles = auth.userInfo.user_object.roles; const org_role = org_roles.find((org: any) => org.org_id == org_id); const user_role = user_roles.find((role: any) => role.org_id == org_id); - + if (org_role && user_role) { if (org_roles_values.includes(org_role.org_role) && user_roles_values.includes(user_role.role_id)) { return true; diff --git a/src/security/auth.py b/src/security/auth.py index 32309774..d125c15d 100644 --- a/src/security/auth.py +++ b/src/security/auth.py @@ -18,7 +18,7 @@ class Settings(BaseModel): authjwt_secret_key: str = "secret" if isDevModeEnabled() else SECRET_KEY authjwt_token_location = {"cookies", "headers"} authjwt_cookie_csrf_protect = False - authjwt_access_token_expires = False if isDevModeEnabled() else 3600 + authjwt_access_token_expires = False if isDevModeEnabled() else 28800 authjwt_cookie_samesite = "lax" authjwt_cookie_secure = True authjwt_cookie_domain = get_learnhouse_config().hosting_config.cookie_config.domain