mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-07 09:03:27 -05:00
fix(api): handle when emailVerified is null (#60429)
This commit is contained in:
committed by
GitHub
parent
00264908e8
commit
a5ec9e1ee7
@@ -612,6 +612,7 @@ export const userGetRoutes: FastifyPluginCallbackTypebox = (
|
||||
const [flags, rest] = splitUser(user);
|
||||
|
||||
const {
|
||||
emailVerified,
|
||||
username,
|
||||
usernameDisplay,
|
||||
completedChallenges,
|
||||
@@ -639,13 +640,14 @@ export const userGetRoutes: FastifyPluginCallbackTypebox = (
|
||||
calendar: getCalendar(
|
||||
progressTimestamps as ProgressTimestamp[] | null
|
||||
),
|
||||
emailVerified: !!emailVerified,
|
||||
// This assertion is necessary until the database is normalized.
|
||||
points: getPoints(
|
||||
progressTimestamps as ProgressTimestamp[] | null
|
||||
),
|
||||
profileUI: normalizeProfileUI(profileUI),
|
||||
// TODO(Post-MVP) remove this and just use emailVerified
|
||||
isEmailVerified: user.emailVerified,
|
||||
isEmailVerified: !!emailVerified,
|
||||
joinDate: new ObjectId(user.id).getTimestamp().toISOString(),
|
||||
location: location ?? '',
|
||||
name: name ?? '',
|
||||
|
||||
Reference in New Issue
Block a user