IfDougelseSa opened a new pull request, #1465:
URL: https://github.com/apache/answer/pull/1465

    ## Description
   
     Fixes plugin notifications for SSO-authenticated users by querying the SSO 
provider's external_id instead of using the notification plugin's name.
   
     ## Problem
   
     Plugin notifications were failing for users authenticated via SSO (GitHub 
OAuth, Google, SAML, etc.) because the code was looking up `external_id` using 
the notification plugin's name instead of the SSO authentication provider.
   
     **Example:**
     - User logs in via `provider = "github"` (SSO)
     - Code searches for `provider = "discord"` (notification plugin)
     - No match found → `ReceiverExternalID` is empty
   
     ## Solution
   
     Query all external logins for the user and use the most recent one (ORDER 
BY updated_at DESC).
   
     ## Changes
   
     - Add `ORDER BY updated_at DESC` to `GetUserExternalLoginList`
     - Update notification code to query all external logins
     - Use first login from ordered list (most recent)
   
     ## Testing
   
     **Before:**
     Receiver External ID:     ← Empty
   
     **After:**
     Receiver External ID: 81540136     ← Populated
   
     Tested with GitHub OAuth SSO and test notification plugin.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to