Add 'registration' event trigger from Shield into Oauth#196
Add 'registration' event trigger from Shield into Oauth#196evansharp wants to merge 1 commit intodatamweb:developfrom
Conversation
…n post-registration.
WalkthroughAdds an event trigger to the OAuth registration flow: imports CodeIgniter\Events\Events and triggers a 'register' event after creating a user and assigning them to the default group. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as OAuth User
participant OP as OAuth Provider
participant C as OAuthController
participant UM as UserModel
participant GM as GroupModel
participant E as Events
participant L as Shield Listener(s)
User->>OP: Authenticate via OAuth
OP-->>C: OAuth callback with user data
C->>UM: Create & save user
UM-->>C: User saved
C->>GM: Add user to default group
GM-->>C: Group assigned
rect rgba(220,255,220,0.3)
note right of C: New integration
C->>E: trigger('register', user)
E-->>L: Notify registered listeners
end
C-->>User: Proceed to post-login flow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR improves OAuth integration with the Shield add-on by causing the Oauth controller to fire the
registerevent in the same way that Shield does when a manual registration occurs.Since this seems like an expected behaviour, I have not added any documentation for it.
Summary by CodeRabbit