Laragear/WebAuthn

[1.2] Incompatibility with User ID that uses ULID.

akubima opened this issue · 2 comments

PHP & Platform

8.1.2 - Ubuntu 22.04 WSL

Database

MySQL 8.0.28

Laravel version

10.10

Have you done this?

  • I have checked my logs and I'm sure is a bug in this package.
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

How to change the webauthn_credentials.authenticatable_id data type?

image
image

I can change it manually after the migration is done but how can I change it in the migration file instead? Is it possible?

$table->morphs('authenticatable', 'webauthn_user_index');

Thanks.

Description

I use ULID as ID (primary key) in the users table and everytime I tried to attest it is failed because the authenticatable_id column in the webauthn_credentials table does not match with the data type of my users table's ID column, how can I change the authenticatable_id to match the users.id data type which is CHAR(26)?

Thanks.

Reproduction

.

Stack trace & logs

No response

I can change it manually after the migration is done but how can I change it in the migration file instead? Is it possible?

Yes. use uuidMorphs instead.

Thanks it works :)