Skip to content

Commit

Permalink
updated NRIC regex for Corppass
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmund-Loh committed Nov 1, 2023
1 parent 319baaa commit 8ed8d73
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/corppass/corppass-helper-ndi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class NdiOidcHelper {

if (sub) {
const trimmedSub = sub.replace(/ /g, "");
const nricRegex = /s=([STFG]\d{7}[A-Z])[^,]*/i;
const nricRegex = /s=([STFGM]\d{7}[A-Z])[^,]*/i;
const [, nric] = trimmedSub.match(nricRegex) || [];
const uuidRegex = /u=([^,]*)/i;
const [, uuid] = trimmedSub.match(uuidRegex) || [];
Expand Down
2 changes: 1 addition & 1 deletion src/corppass/corppass-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class OidcHelper {

if (sub) {
const trimmedSub = sub.replace(/ /g, '');
const nricRegex = /s=([STFG]\d{7}[A-Z])[^,]*/i;
const nricRegex = /s=([STFGM]\d{7}[A-Z])[^,]*/i;
const [, nric] = trimmedSub.match(nricRegex) || [];
const uuidRegex = /u=([^,]*)/i;
const [, uuid] = trimmedSub.match(uuidRegex) || [];
Expand Down

0 comments on commit 8ed8d73

Please sign in to comment.