Incorrect value get stored in surname field
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 103
Description
## Describe the bug
When creating a user, the **surname** field is incorrectly populated with the value of **onPremisesSamAccountName** (i.e., the username) instead of extracting the actual last name from the **displayName**.
## Steps to reproduce
1. create user
```
curl -vk -X POST -u admin:admin https://localhost:9200/graph/v1.0/users \
-H "Content-Type: application/json" \
-d '{
"onPremisesSamAccountName": "hope",
"displayName": "romi shrestha",
"mail": "romi@gmail.com",
"passwordProfile": {
"password": "1234"
}
}'
```
2. Then we get a response
```
{
"displayName": "romi shrestha",
"id": "eeeca5f4-50bd-4863-8d4b-0b53234bae46",
"mail": "romi@gmail.com",
"onPremisesSamAccountName": "hope",
"surname": "hope",
"userType": "Member"
}
```
## Expected behavior
**surname** should be "shrestha" — the last name parsed from displayName.
## Actual behavior
**surname** is "hope" — incorrectly using the value of onPremisesSamAccountName.
## Setup
Please describe how you started the server and provide a list of relevant environment variables or configuration files.
```console
OCIS_version=7.1.2+12415ad52
Web client version=11.3.1
```
## Additional context
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.