خرید بک لینک

Vote count: 0

I'm currently working on a Angular (Front End) - Laravel (API) application. I need to know whether I can make a hybrid log in.

Currently I'm using a stored procedure for the log in. But then if the login was succesful I want to send a JWT token to the client side. Is this possible without calling the JWT attempt method? Does JWT has something like a JWT::getToken($mail); method? If I can't do this, are any other work arounds?

$mail = $request['email'];
$password = $request['password'];

$query = new Query("CALL SP_USER_LOG_IN(?,?, @outputMessage)");
$query->addParameter(1, $mail);
$query->addParameter(2, $password);

$outputMessage = DB::executeQuery($query);

if($outputMessage === null)
{
    //It means the login was successful
    $token = JWT::getToken($mail);

    retu ["error" => NULL, "token" => $token];
}
else
{
    retu ["error" => $outputMessage];
}

NOTE

I just found out about JWT and it looks like a really good solution since I'm working with a light angular application on the front end. But since I must use a stored procedure, I don't how to proceed.

asked 49 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 19 فروردين 1395 ساعت: 9:07

صفحه بندی