add refresh user permissions on sign in and sign up

This commit is contained in:
Simon Larsen 2023-03-10 15:03:15 +00:00
parent dd0f1c0ec0
commit ed595e66a4
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -25,6 +25,7 @@ import { DashboardRoute, Domain, HttpProtocol } from 'CommonServer/Config';
import Route from 'Common/Types/API/Route';
import TeamMember from 'Model/Models/TeamMember';
import TeamMemberService from 'CommonServer/Services/TeamMemberService';
import AccessTokenService from 'CommonServer/Services/AccessTokenService';
const router: ExpressRouter = Express.getRouter();
@ -398,6 +399,9 @@ router.post(
OneUptimeDate.getSecondsInDays(new PositiveNumber(30))
);
// Refresh Permissions for this user here.
await AccessTokenService.refreshUserAllPermissions(alreadySavedUser.id!);
return Response.redirect(
req,
res,