ecamp / ecamp/ecamp3

Consistent user validation

Open
#3,196 1 comment 0 reactions 0 assignees View on GitHub
agents:ignore
Dominant language
PHP
Stars
156
Forks
72
Avg merge
12h 43m
Merged PRs (30d)
203

Description

In the frontend, when registering, we currently require first name and last name:
![Screenshot 2022-12-05 at 16-32-44 eCamp3](https://user-images.githubusercontent.com/7566995/205695809-e606b52b-16a1-40d3-b265-53be37f17915.png)

In the API and on the profile edit page, we require neither (because we used to require a username, which we removed in #3004)

We also have a field "nickname" in the API, which is not exposed in the frontend at all (except in the calculated field displayName which comes directly from the API).

All of this is probably wrong right now. We should choose one set of fields and validations and use that in the frontend [register page](https://github.com/ecamp/ecamp3/blob/devel/frontend/src/views/auth/Register.vue#L6..L22), frontend [profile edit page](https://github.com/ecamp/ecamp3/blob/devel/frontend/src/views/Profile.vue#L33..L42), [API](https://github.com/ecamp/ecamp3/blob/devel/api/src/Entity/Profile.php) and [terms of service](https://github.com/ecamp/ecamp-site/pull/12#discussion_r1039717795). We should also make sure that our [display name logic](https://github.com/ecamp/ecamp3/blob/devel/api/src/Entity/Profile.php#L160) and [avatar initials logic](https://github.com/ecamp/ecamp3/blob/devel/common/helpers/initials.js) can handle whatever guarantees and non-guarantees for names we decide on.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.