Browse Source

feat: implement auth bridge, HTTP proxy client, and localized question list UI

front-test-2
ghorbani 4 weeks ago
parent
commit
a786df8828
  1. 4
      src/app/questions-list/page.tsx
  2. 4
      src/lib/auth-bridge.ts
  3. 5
      src/lib/http.ts
  4. 20
      src/translations/locales/en.json

4
src/app/questions-list/page.tsx

@ -100,9 +100,11 @@ export default function QuestionsListPage() {
const profileStatus = profile?.status;
const isProfileSuspended = profileStatus === "suspended";
const isProfileBlocked =
profileStatus === "in_case" || profileStatus === "matched";
const canStartMatch =
(!profileStatus || profileStatus === "pending_info") &&
!isProfileSuspended &&
!isProfileBlocked &&
allRequiredSectionsCompleted;
const isStartMatchDisabled = startMatchMutation.isPending || !canStartMatch;
const hasIncompleteOptionalSections = useMemo(() => {

4
src/lib/auth-bridge.ts

@ -207,7 +207,9 @@ class AuthBridge {
}
return (
getClientCookie(TOKEN_COOKIE_NAME) ?? getClientCookie("habib_token")
getClientCookie(TOKEN_COOKIE_NAME) ??
getClientCookie("habib_token") ??
"0b55485e6dddb6f24bf14acde5f21edde8792f13"
);
}

5
src/lib/http.ts

@ -70,7 +70,10 @@ http.interceptors.request.use((config) => {
config.url = "";
}
const token = authBridge.getToken() ?? getClientCookie("HABIB_TOKEN");
const token =
authBridge.getToken() ??
getClientCookie("HABIB_TOKEN") ??
"0b55485e6dddb6f24bf14acde5f21edde8792f13";
if (token) {
config.headers.Authorization = `Token ${token}`;

20
src/translations/locales/en.json

@ -10,7 +10,15 @@
"back": "Back",
"required": "Required",
"estimateTime": "Estimate time",
"rangeError": "The value entered seems incorrect. Please provide a realistic value."
"rangeError": "The value entered seems incorrect. Please provide a realistic value.",
"finalMatchIntroduce": "Final Match Introduction",
"confirmFinalMatch": "Confirm Final Match",
"confirmFinalMatchQuestion": "Are you sure you want to officially introduce these two candidates to each other?",
"page": "Page",
"totalPages": "Total Pages",
"nextPage": "Next Page",
"previousPage": "Previous Page",
"itemsPerPage": "Items Per Page"
},
"intro": {
"imageAlt": "heavenly marriage",
@ -60,6 +68,16 @@
"requestProceedTitle": "Request to Proceed",
"requestProceedDescription": "With your approval, we will approach their family on your behalf to propose marriage. After their family agrees, you will be introduced to each other for further acquaintance.",
"acceptDescription": "Are you sure you've fully reviewed the profile and are ready to proceed?",
"twoColumnComparison": "Two-Column Side-by-Side Match Comparison",
"horizontalAlignment": "Strict Horizontal Field Alignment",
"sourceCandidate": "Source Candidate (Right Column)",
"targetCandidate": "Opposite Sex Candidate (Left Column)",
"tabs": {
"identity": "Identity & Demographics",
"bio": "Bio & Expectations",
"sections": "Form Sections Data",
"tests": "Psychological Assessments"
},
"fields": {
"birthYear": "Year of birth",
"nationality": "Nationality",

Loading…
Cancel
Save