Skip to content

Bug: Error customizing login identifier and not using email #904

@alivaraste

Description

@alivaraste

PHP Version

8.1.8

CodeIgniter4 Version

4.4.2

Shield Version

1.0.0-beta.2

Which operating systems have you tested for this bug?

Linux

Which server did you use?

apache

Database

MariaDB

Did you customize Shield?

No

What happened?

I am going to receive the mobile number from the user and send him a verification code, so according to the documentation, I created a mobile column and wrote the mobile number in the ValidFields variable in the config and deleted the username.
when submit form with mobile and password this error accourded: "There is no data to insert" because it is not possible to create a user without a username and the mobile field that is sent along with the username is not saved in the user table.

So i deleted the mobile column and used the username to save the mobile number, which caused a new problem, I don't save email, so only one user can be created without email, and subsequent users receive a duplicate key error. Because there is a key called type_secret in the auth_identities table, which causes this problem.

Thank you for letting me know if I'm wrong, and if not, consider fixing these problems in the next versions

Steps to Reproduce

Expected Output

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions