Support the ongoing development of Laravel.io →
Authentication
Last updated 1 year ago.
0

there are two ways of doing this..

  1. there is an authenticate method i.e.
if (Auth::attempt(['email' => $email, 'password' => $password])) {
            // Authentication passed...
            return redirect()->intended('dashboard');
        }

send another array called 'activation_key' => null or "" or whatever.. and Laravel will check that field too.

  1. hunt down the postLogin method that Laravel uses & replicate/override that inside your AuthContollers with exactly what laravel does, but afterwards check if auth::user()->Activation_key = null, 0 etc if so redirect them to wherever you want (& log them out ofcourse before doing that)

The way you are suggesting could be done.. you have $request in your middleware, so you get the username user entered, and do a query to see if activation_key is null etc and if so redirect back.. not sure why this is confusing?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Pekinese pekinese Joined 21 Nov 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.