(applicantId)
| 161 | |
| 162 | |
| 163 | export async function isAuthApplicant(applicantId) { |
| 164 | /* |
| 165 | * Check if the user is authorized to access the applicant |
| 166 | * @param applicantId [String]: applicantId |
| 167 | * @return: [Boolean]: whether the user is authorized to access the applicant |
| 168 | */ |
| 169 | if (!applicantId) { |
| 170 | return false; |
| 171 | } |
| 172 | const displayName = await getDisplayName(); |
| 173 | const applicantUsername = applicantId.split('@')[0]; |
| 174 | return applicantUsername === displayName; |
| 175 | } |
no test coverage detected