feat: Add context to Cloud Code Triggers beforeLogin and afterLogin (#8724)

This commit is contained in:
Diamond Lewis
2023-09-20 03:47:35 -05:00
committed by GitHub
parent 05939858af
commit a9c34ef1e2
4 changed files with 38 additions and 4 deletions

View File

@@ -259,7 +259,8 @@ export class UsersRouter extends ClassesRouter {
req.auth,
Parse.User.fromJSON(Object.assign({ className: '_User' }, user)),
null,
req.config
req.config,
req.info.context
);
// If we have some new validated authData update directly
@@ -291,7 +292,8 @@ export class UsersRouter extends ClassesRouter {
{ ...req.auth, user: afterLoginUser },
afterLoginUser,
null,
req.config
req.config,
req.info.context
);
if (authDataResponse) {

View File

@@ -270,6 +270,8 @@ export function getRequestObject(
triggerType === Types.afterSave ||
triggerType === Types.beforeDelete ||
triggerType === Types.afterDelete ||
triggerType === Types.beforeLogin ||
triggerType === Types.afterLogin ||
triggerType === Types.afterFind
) {
// Set a copy of the context on the request object.