|
@@ -29,9 +29,17 @@ export const get = async (req: ExpressRequest, res: ExpressResponse): GetResult
|
|
|
userVerified: true,
|
|
|
});
|
|
|
}
|
|
|
+ const verifiedResult = await tryDo(rpcClient.userVerified({ userId: req.session.userId }));
|
|
|
+ let verified = true;
|
|
|
+ if (!verifiedResult.ok) {
|
|
|
+ logger.error("Failed to check verified state: %s", verifiedResult.error);
|
|
|
+ } else {
|
|
|
+ verified = verifiedResult.result.verified;
|
|
|
+ logger.verbose("User %s (%s) verified: %s", req.session.username, req.session.userId, verified);
|
|
|
+ }
|
|
|
return res.json({
|
|
|
captchaSitekey: ENV.HCAPTCHA_SITEKEY,
|
|
|
- userVerified: (await rpcClient.userVerified({ userId: req.session.userId })).verified,
|
|
|
+ userVerified: verified,
|
|
|
});
|
|
|
};
|
|
|
|