简体   繁体   English

在 sql server 中没有加密密码的 Laravel 登录

[英]Laravel login without encrypt password in sql server

I want to login in with sql server data, I want to login with vcUsuario as user and vcclave as password, is it possible to use make:auth configuration to login with these credentials without encrypting vcclave?我想用 sql server 数据登录,我想用 vcUsuario 作为用户登录,用 vcclave 作为密码,是否可以使用 make:auth 配置使用这些凭据登录而不加密 vcclave? or do I need to make and encryptyng in sql server data?或者我需要在 sql server 数据中制作和加密吗? please help请帮忙在此处输入图片说明

You can login to a user in laravel use Auth::login($user);你可以在 laravel 中使用Auth::login($user); . .

It's better to encrypt your password to have a safer website but you can create login form and custom login function in your Controller without encrypting.最好加密您的密码以获得更安全的网站,但您可以在不加密的情况下在控制器中创建登录表单和自定义登录功能。

Example code after check your password is correct in collection :在集合中检查您的密码是否正确后的示例代码:

if($correct){
   Auth::login($user);
   return redirect('/home');
}else{
   return redirect('/login');
}

$user is your user login data that you can get it from collection with code like this : $user 是您的用户登录数据,您可以使用以下代码从集合中获取它:

$user = User::whereUsername($username)->wherePassword($password)->first();

But It's better to change name of vsUsuario to vs_usuraio and vcclave to vc_clave.但是最好将vsUsuario 的名称更改为vs_usuraio,将vcclave 更改为vc_clave。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM