Monday, April 3, 2017

Laravel: two-step login and different database

I decided to rewrite my project that was written from scratch to laravel. In my actual project i have login functionality that works in this way:

  1. check if in database called let's say 'houses' in table 'houses' there is house that was provided by login-form ($house). check password etc.

  2. connect to database called $house and display list of all family members. To proceed you have to chose which one you want to be and then give password for specific user

  3. authenticate as specific user

Problems I've encountered:

  1. I know about Laravel's login system and it's just one-step. How to create functionality like that in laravel that is either safe and works exactly the same (i want to keep my mysql schemes)?
  2. How to change database after loggining in so in only specified parts of website?


via Ethris

Advertisement