UniversityOfHelsinkiCS / ipsutin

The IP web-tool program
https://innotin.helsinki.fi/
0 stars 0 forks source link

Debugging: Cannot read properties of undefined (reading 'some') #136

Closed Catrovitch closed 3 months ago

Catrovitch commented 3 months ago

So I have now been able to reproduce the problem, but I am not sure exactly what is causing it.

  1. When I log in with my credentials --> no problem

  2. When I log in with my credentials, but wrong password --> no Error

  3. My friend at Uni logs in with her credentials --> no problem

  4. The problem seems to occur only when my father tries to log in (I asked for his feedback on the Inventor's Assistant) While he's been at Aalto for years, he still has access to HY credentials. His credentials should be up to date.

  5. The ERROR occurs at: src/server/util/oidc.ts: const checkAdmin = (iamGroups: string[]) => iamGroups.some((iamGroup) => ['grp-toska', 'grp-his'].includes(iamGroup)) iamGroups is somehow undefined for him.

  6. I asked my father to try to login to some other HY service (Flamma) and the same problem occured there so the core issue here is not unique to Innotin. He will contact HelpDesk to see if they can figure out what is the issue with his account. Anyhow we could implement better error handling for unidentified values such as iamGroup?

Does this sound like a good plan for this error? (I don't have experience debugging these kinds of errors, so do tell me if I am missing something)

UPDATE: He was able to log in to Flamma when using Firefox - error occured using Safari. Innotin seems to work with neither. Does anyone have any prior experience whith a similar situation?

Catrovitch commented 3 months ago

Fix: Add possibility for iamGroups to be unidentified or null. Make conditional handling of these scenarios.