File tree Expand file tree Collapse file tree 3 files changed +2
-23
lines changed
Expand file tree Collapse file tree 3 files changed +2
-23
lines changed Original file line number Diff line number Diff line change 7979 "react-dom" : " ^16.8.6" ,
8080 "ts-node" : " ^8.5.2" ,
8181 "typescript" : " 4.2.4" ,
82- "uuid" : " ^7.0.3" ,
83- "validator" : " ^13.15.20"
82+ "uuid" : " ^7.0.3"
8483 },
8584 "devDependencies" : {
8685 "@graphql-codegen/cli" : " ^1.21.8" ,
9493 "@types/jest" : " ^24.0.11" ,
9594 "@types/lodash" : " ^4.14.122" ,
9695 "@types/node" : " ^14.17.1" ,
97- "@types/validator" : " ^13.15.4" ,
9896 "concurrently" : " ^4.1.0" ,
9997 "husky" : " ^1.3.1" ,
10098 "jest" : " ^24.3.1" ,
Original file line number Diff line number Diff line change 1- import validator from 'validator'
21import {
32 IUserInfo ,
43 requestGroups ,
@@ -14,10 +13,6 @@ export async function assignUserToGroups(userInfo: IUserInfo): Promise<IUserInfo
1413 return userInfo
1514 }
1615
17- if ( ! validator . isEmail ( userInfo . email ) ) {
18- return userInfo
19- }
20-
2116 const settings = await getSettings ( )
2217 const domainGroups = settings . domain_groups
2318 const autoDomainGroups = settings . auto_domain_groups
@@ -36,11 +31,7 @@ export async function assignUserToGroups(userInfo: IUserInfo): Promise<IUserInfo
3631 )
3732
3833 const sessionGroups = userInfo . groups
39- const parsedDomains = userInfo . email . split ( '@' )
40- const emailDomain = parsedDomains [ parsedDomains . length - 1 ] ?. toLowerCase ( )
41- const emailDomainGroups = assignGroups . filter (
42- ( dg ) => emailDomain === dg . domain . toLowerCase ( )
43- )
34+ const emailDomainGroups = assignGroups . filter ( ( dg ) => userInfo . email . endsWith ( dg . domain ) )
4435 const groupAssignments = uniq ( flatten ( emailDomainGroups . map ( ( { groups } ) => groups ) ) )
4536 const assignToGroups = difference ( groupAssignments , sessionGroups )
4637
Original file line number Diff line number Diff line change 23002300 resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e"
23012301 integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==
23022302
2303- " @types/validator@^13.15.4 " :
2304- version "13.15.4"
2305- resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.15.4.tgz#38a97ae54747416f745afdfc678f041713082635"
2306- integrity sha512-LSFfpSnJJY9wbC0LQxgvfb+ynbHftFo0tMsFOl/J4wexLnYMmDSPaj2ZyDv3TkfL1UePxPrxOWJfbiRS8mQv7A==
2307-
2308230323092304 version "1.0.2"
23102305 resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.2.tgz#d2855c6a312b7da73ed16ba6781815bf30c6187a"
@@ -10944,11 +10939,6 @@ validate-npm-package-license@^3.0.1:
1094410939 spdx-correct "^3.0.0"
1094510940 spdx-expression-parse "^3.0.0"
1094610941
10947- validator@^13.15.20 :
10948- version "13.15.20"
10949- resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.20.tgz#054e9238109538a1bf46ae3e1290845a64fa2186"
10950- integrity sha512-KxPOq3V2LmfQPP4eqf3Mq/zrT0Dqp2Vmx2Bn285LwVahLc+CsxOM0crBHczm8ijlcjZ0Q5Xd6LW3z3odTPnlrw==
10951-
10952109421095310943 version "1.0.11"
1095410944 resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140"
You can’t perform that action at this time.
0 commit comments