events¶
pyramid_fullauth emits these events during whole cycle.
Registration¶
- class pyramid_fullauth.events.BeforeRegister(request, user, errors)[source]¶
Execute custom code at the start of registration process.
Note
User object is not yet in session.
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
errors (dict) – a dictionary with wrong/not submitted fields with format - fields for which error occured: error message
- class pyramid_fullauth.events.AfterRegister(request, user, response_values)[source]¶
Add custom post-processing code in registration process.
Can be used to add e.g. e-mail sending with registration links.
Note
User object is already in a session.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Warning
If HTTPRedirection is risen from event listener, then response_values will not be used!
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
response_values (dict) – a dictionary with response values
Account activation¶
- class pyramid_fullauth.events.AfterActivate(request, user)[source]¶
Add custom post-processing logic after user gets activated.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
Password reset¶
- class pyramid_fullauth.events.AfterResetRequest(request, user)[source]¶
Add custom post-processing after user sends request to reset password.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
- class pyramid_fullauth.events.AfterReset(request, user)[source]¶
Add custom post-processing after the actual reset-password process.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
Login¶
- class pyramid_fullauth.events.AlreadyLoggedIn(request)[source]¶
Allow execute custom logic, when logged in user tries to log in again.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
- class pyramid_fullauth.events.BeforeLogIn(request, user)[source]¶
Add custom logic before user gets logged in.
Note
Action emitting this event, should catch all AttributeError that might be risen in event listener. User param set to None when user is not found or request method is GET.
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
- class pyramid_fullauth.events.AfterLogIn(request, user)[source]¶
Add custom logic after user logs in.
Initialize event.
- Parameters:
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
Social registration/login¶
Adds custom logic before the social login process start.
Initialize base events.
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
profile (dict) – a dictionary with profile data
Add custom logic after user registers through social network.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Initialize event.
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
profile (dict) – a dictionary with profile data
response_values (dict) – a dictionary with response values
Custom logic after user logs in through social network.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Initialize base events.
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
profile (dict) – a dictionary with profile data
Event raised when social account is already connected to some other user.
Allow to add custom logic, when someone tries to connect social account to second user in application.
Note
Action emitting this event, should catch all HTTPRedirection that might be risen in event listener.
Initialize event.
request (pyramid.request.Request) – request object
user (pyramid_fullauth.models.User) – user object
profile (dict) – a dictionary with profile data
response_values (dict) – a dictionary with response values