October: Standardize the User model

Created on 23 Apr 2020  路  2Comments  路  Source: octobercms/october

I've been using OctoberCMS to build a few mobile applications and I wrote a plugin as well for my convenience to re-use code. However, some projects require multi-level auth i.e. backend user / frontend user which is already supported by OctoberCMS. However, I found there are inconsistencies in the field names.

For example, the frontend User model has: _email, name, surname, login, password_ as the fields names.

Whereas, the backend User model has: _first_name, last_name, login, email, password_ as the field names.

I am happy with login, email and password fields since they have the same name. However, I do not understand why the name fields differ. This hinders me from writing a single User class in my mobile apps (Kotlin/Swift) and I so create FrontendUser and BackendUser. Is there any point to it and are you achieving something doing so??

Question

Most helpful comment

@daftspunk So you wanted the surname to be optional for backend users and that is why you chose it over a more consistent first_name and last_name across both rainlab鈥檚 user model and october鈥檚 user model?

All 2 comments

first_name and last_name indicate both are required fields

name and surname indicate that surname is optional

name could be used for the full name (name: Adam Person)
name and surname could be broken apart (name: Adam, surname: Person)

@daftspunk So you wanted the surname to be optional for backend users and that is why you chose it over a more consistent first_name and last_name across both rainlab鈥檚 user model and october鈥檚 user model?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oppin picture oppin  路  3Comments

d3monfiend picture d3monfiend  路  3Comments

axomat picture axomat  路  3Comments

mittultechnobrave picture mittultechnobrave  路  3Comments

sozonovalexey picture sozonovalexey  路  3Comments