Custom email verification in Laravel 8

Viewed 1408

I have Laravel 8 and Jetstream installed and I need a little help with setting up custom email verification.

I'm currently working on a Unity game which uses Laravel for authentication. So I'm working on adding some extra security by also sending the user's deviceID from Unity to Laravel and would like to verify via email whenever the user logs in from a new device.

I added a migration to add a users_device table to the database which has the following columns: id, email, device, device_verified_at. I'm assuming a user can have more than one authenticated device so I set it up as a separate table from the users table.

The Unity side is all done but I'm having trouble setting it up on Laravel. Initially I tried to piggy-back off of the existing email verification system but I soon realized when a user tries to login from a new device it should ask for email verification but for the old device it should work as normal. By setting $user->email_verified_at = null; this would also lock out the user that's still on the old device.

Can someone here help me set up email verification for deviceIDs?

0 Answers
Related