AdRock
169
2
Laravel

Custom login and authentication

Posted 2 months ago by AdRock

I don't know if this has ever been asked before but I'll ask anyway as searches don't return what I'm looking for/

I need a custom login/authentication for Laravel 5.8

The login for would look exactly the same.

When the user enters their email and password, I need the login/auth to get the domain of the email which is a database I connect to. and then connect to that database to search for the username which is the first part of the email.

I am already using tenants to get data from different database depending on what connection I tell it to use. I am not sure how to update which files to do the authentication.

This is how I see it working

  1. User enters email and password and submits
  2. The login/auth explodes the email address and the domain is the connection to use
  3. Query the main database and get the connection details (I can do this already, just need to be part of auth)
  4. Query the customer database to get the username and password that match what the user logged in with

I can do most of it, I just don't know how to update the Auth

Please sign in or create an account to participate in this conversation.