Closed philiplb closed 2 years ago
Hello! How are you?
The default model "KeycloakUser" uses the e-mail as ID (you can check here).
So you shouldn't use "foreignId" as column type to "user_id". Please, change it to string.
Hi,
thank you for the very fast answer :) Yes, true. I am using this type currently due to this documentation: https://laravel.com/docs/8.x/session#database Do you know if it is save to just change that to a string type?
I'm not sure, but you can try.
Just make a rollback and change the column type. But... This user provider is not saving user to database. So a foreign key will always fail.
// With Foreign Key
$table->string('user_id')->references('id')->on('users');
// Without Foreign Key
$table->string('user_id');
Or... you can implement a Eloquent Model. Read more.
Yeah, I'm a bit puzzled that it wants to touch the user_id at all. Or why this session schema from Laravels documentation actually has this field at all.
It seems to work fine, thx.
Hi,
we are using the database for storing the sessions with the recommended schema:
But using the given model in the provider like this (auth.php):
It results in an exception when it tries to store the session:
What could I do here?