Procházet zdrojové kódy

Merge pull request #27637 from overleaf/jel-remove-unused-group-sso

[web] Use `providerId` for group SSO and remove unused `universityId`

GitOrigin-RevId: 0928cdfee78cae5cdede57159b9968c15e26f27c
Jessica Lawshe před 1 rokem
rodič
revize
f1c59be2d2

+ 1 - 1
services/web/app/src/Features/SamlLog/SamlLogHandler.js

@@ -21,7 +21,7 @@ async function log(req, data, samlAssertion) {
     const { saml } = req.session
     const { saml } = req.session
     const userId = SessionManager.getLoggedInUserId(req.session)
     const userId = SessionManager.getLoggedInUserId(req.session)
 
 
-    providerId = (req.session.saml?.universityId || '').toString()
+    providerId = (req.session.saml?.providerId || '').toString()
     sessionId = (req.sessionID || '').toString().substr(0, 8)
     sessionId = (req.sessionID || '').toString().substr(0, 8)
 
 
     const samlLog = new SamlLog()
     const samlLog = new SamlLog()

+ 3 - 3
services/web/test/unit/src/SamlLog/SamlLogHandlerTests.js

@@ -32,7 +32,7 @@ describe('SamlLogHandler', function () {
     beforeEach(async function () {
     beforeEach(async function () {
       await SamlLogHandler.promises.log(
       await SamlLogHandler.promises.log(
         {
         {
-          session: { saml: { universityId: providerId } },
+          session: { saml: { providerId } },
           sessionID: sessionId,
           sessionID: sessionId,
           path: '/saml/ukamf',
           path: '/saml/ukamf',
         },
         },
@@ -46,7 +46,7 @@ describe('SamlLogHandler', function () {
       samlLog.jsonData.should.equal(
       samlLog.jsonData.should.equal(
         JSON.stringify({
         JSON.stringify({
           foo: true,
           foo: true,
-          samlSession: { universityId: 'provider-id' },
+          samlSession: { providerId: 'provider-id' },
         })
         })
       )
       )
       expect(samlLog.data).to.be.undefined
       expect(samlLog.data).to.be.undefined
@@ -61,7 +61,7 @@ describe('SamlLogHandler', function () {
 
 
       await SamlLogHandler.promises.log(
       await SamlLogHandler.promises.log(
         {
         {
-          session: { saml: { universityId: providerId } },
+          session: { saml: { providerId } },
           sessionID: sessionId,
           sessionID: sessionId,
           path: '/saml/ukamf',
           path: '/saml/ukamf',
         },
         },