- Timestamp:
- 09/15/26 21:16:02 (8 days ago)
- Branches:
- master
- Children:
- b8093a0
- Parents:
- 4fe4582
- Location:
- src/lib
- Files:
-
- 2 added
- 1 deleted
- 2 edited
-
admin-api.ts (added)
-
api.ts (added)
-
auth.ts (modified) (3 diffs)
-
pdf-generators.ts (modified) (3 diffs)
-
prof-demo-store.ts (deleted)
Legend:
- Unmodified
- Added
- Removed
-
src/lib/auth.ts
r4fe4582 r8496f3c 1 import { API_BASE_URL } from './api'; 1 2 export type AuthTokens = { 2 3 accessToken: string; … … 4 5 }; 5 6 6 export type UserRole = 'Professor' | 'Student' | string;7 export type UserRole = 'Professor' | 'Student' | 'Admin' | string; 7 8 8 9 export type AuthSession = AuthTokens & { … … 91 92 92 93 export async function login(params: { email: string; password: string }): Promise<AuthSession> { 93 const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL ?? 'https://iknow-api.onrender.com';94 const baseUrl = API_BASE_URL; 94 95 95 96 const response = await fetch(`${baseUrl}/api/auth/login`, { -
src/lib/pdf-generators.ts
r4fe4582 r8496f3c 2 2 import autoTable from 'jspdf-autotable'; 3 3 import { loadCyrillicFonts } from './pdf-fonts'; 4 import { apiUrl } from './api'; 4 5 5 6 /* ---------- shared types ---------- */ … … 1056 1057 ): Promise<void> { 1057 1058 // Fetch student profile 1058 const profileRes = await fetch( 'https://iknow-api.onrender.com/api/user/getUser', {1059 const profileRes = await fetch(apiUrl('/api/user/getUser'), { 1059 1060 headers: { Authorization: `Bearer ${accessToken}` }, 1060 1061 }); … … 1095 1096 let passedExams: PassedExam[] = []; 1096 1097 if (needsExams) { 1097 const examsRes = await fetch( 'https://iknow-api.onrender.com/api/user/getPassedSubjects', {1098 const examsRes = await fetch(apiUrl('/api/user/getPassedSubjects'), { 1098 1099 headers: { Authorization: `Bearer ${accessToken}` }, 1099 1100 });
Note:
See TracChangeset
for help on using the changeset viewer.
