fix: impersonation logout, applicant learning hub redirect, nav click tracking
- Sign Out button during impersonation now returns to admin instead of destroying the session (fixes multi-click logout issue) - Applicant nav now respects learning_hub_external setting like jury/mentor - Track Learning Hub nav clicks via audit log (LEARNING_HUB_CLICK action) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -271,6 +271,24 @@ export const learningResourceRouter = router({
|
||||
return { success: true }
|
||||
}),
|
||||
|
||||
/**
|
||||
* Log when a user clicks the Learning Hub nav link (especially external).
|
||||
* Creates an audit log entry so admins can see who accessed it.
|
||||
*/
|
||||
logNavClick: protectedProcedure
|
||||
.input(z.object({ url: z.string() }))
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
await ctx.prisma.auditLog.create({
|
||||
data: {
|
||||
userId: ctx.user.id,
|
||||
action: 'LEARNING_HUB_CLICK',
|
||||
entityType: 'LearningResource',
|
||||
detailsJson: { url: input.url, role: ctx.user.role },
|
||||
},
|
||||
}).catch(() => {})
|
||||
return { success: true }
|
||||
}),
|
||||
|
||||
/**
|
||||
* Create a new resource (admin only)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user