File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import validator from 'validator'
12import {
23 IUserInfo ,
34 requestGroups ,
@@ -13,6 +14,10 @@ export async function assignUserToGroups(userInfo: IUserInfo): Promise<IUserInfo
1314 return userInfo
1415 }
1516
17+ if ( ! validator . isEmail ( userInfo . email ) ) {
18+ return userInfo
19+ }
20+
1621 const settings = await getSettings ( )
1722 const domainGroups = settings . domain_groups
1823 const autoDomainGroups = settings . auto_domain_groups
@@ -31,7 +36,8 @@ export async function assignUserToGroups(userInfo: IUserInfo): Promise<IUserInfo
3136 )
3237
3338 const sessionGroups = userInfo . groups
34- const emailDomain = userInfo . email . split ( '@' ) [ 1 ] ?. toLowerCase ( )
39+ const parsedDomains = userInfo . email . split ( '@' )
40+ const emailDomain = parsedDomains [ parsedDomains . length - 1 ] ?. toLowerCase ( )
3541 const emailDomainGroups = assignGroups . filter (
3642 ( dg ) => emailDomain === dg . domain . toLowerCase ( )
3743 )
Original file line number Diff line number Diff line change 44 "6" : " Oy Pohjolan Liikenne Ab" ,
55 "7" : " Sipoon Linja Oy" ,
66 "10" : " Oy Liikenne Ab" ,
7- "12" : " Helsingin Bussiliikenne Oy" ,
7+ "12" : " Koiviston Auto Helsinki Oy" ,
88 "17" : " Tammelundin Liikenne Oy" ,
99 "18" : " Oy Pohjolan Kaupunkiliikenne Ab" ,
1010 "19" : " Etelä-Suomen Linjaliikenne Oy" ,
3838 "59" : " Tilausliikenne Nikkanen Helsinki Oy" ,
3939 "60" : " Suomenlinnan Liikenne Oy" ,
4040 "61" : " TTS Työtehoseura" ,
41+ "64" : " Taksikuljetus Harri Vuolle Oy" ,
4142 "89" : " Metropolia" ,
4243 "90" : " VR Oy" ,
4344 "93" : " VR-laiturilukijat" ,
You can’t perform that action at this time.
0 commit comments