本文整理汇总了TypeScript中claims/claimStoreClient.ClaimStoreClient.linkDefendant方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ClaimStoreClient.linkDefendant方法的具体用法?TypeScript ClaimStoreClient.linkDefendant怎么用?TypeScript ClaimStoreClient.linkDefendant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类claims/claimStoreClient.ClaimStoreClient
的用法示例。
在下文中一共展示了ClaimStoreClient.linkDefendant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Cookies
ErrorHandling.apply(async (req: express.Request,
res: express.Response,
next: express.NextFunction): Promise<void> => {
const cookies = new Cookies(req, res)
let user
try {
const authenticationToken = await getAuthToken(req)
if (authenticationToken) {
user = await IdamClient.retrieveUserFor(authenticationToken)
res.locals.isLoggedIn = true
res.locals.user = user
setAuthCookie(cookies, authenticationToken)
}
} catch (err) {
return loginErrorHandler(req, res, cookies, next, err)
}
if (res.locals.isLoggedIn) {
if (isDefendantFirstContactPinLogin(req)) {
// re-set state cookie as it was cleared above, we need it in this case
cookies.set(stateCookieName, req.query.state)
return res.redirect(FirstContactPaths.claimSummaryPage.uri)
} else {
await claimStoreClient.linkDefendant(user)
res.redirect(await retrieveRedirectForLandingPage(req, res))
}
} else {
if (res.locals.code) {
trackCustomEvent('Authentication token undefined (jwt defined)',
{ requestValue: req.query.state })
}
res.redirect(OAuthHelper.forLogin(req, res))
}
}))