Skip to content

Conversation

@kenjis
Copy link
Member

@kenjis kenjis commented May 27, 2022

Need to rebase after merging #177

Identifiers can be added, and it will be not possible to determine what they are just from the identifier string.
Currently, token: is also added to access tokens.
Also, if there is no constraint, it is not possible to tell whether it is an email or a username just from the string.

It is easier to know what it is if we add a column for identifier type.

  • add id_type in auth_logins and auth_token_logins
    • type: email_password, username, magic-link, and access_token
  • add validation error check in CheckQueryReturnTrait
  • add const ID_TYPE_* in Session and AccessTokens

@kenjis kenjis force-pushed the add-id-type-logins-table branch 2 times, most recently from 5490399 to 4612b1f Compare May 27, 2022 01:56
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this better than the prefixes. A few suggestions.

@kenjis kenjis force-pushed the add-id-type-logins-table branch from 4612b1f to a73621e Compare May 27, 2022 10:47
Co-authored-by: MGatner <mgatner@icloud.com>
@kenjis kenjis force-pushed the add-id-type-logins-table branch from 194a0f5 to edd3510 Compare May 27, 2022 10:57
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
'ip_address' => ['type' => 'varchar', 'constraint' => 255],
'user_agent' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
'id_type' => ['type' => 'varchar', 'constraint' => 255],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing for here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@kenjis kenjis requested a review from MGatner May 29, 2022 01:54
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@kenjis kenjis merged commit cb7e0c0 into codeigniter4:develop May 30, 2022
@kenjis kenjis deleted the add-id-type-logins-table branch May 30, 2022 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants