当前位置:网站首页>Attempt method in laravel user authentication
Attempt method in laravel user authentication
2022-07-28 04:29:00 【TO_ WebNow】
$credentials = request(['name', 'password']);
if (!$token = auth('api')->attempt($credentials)) {
return response()->json(['error' => 'Unauthorized'], 401);
}
attempt Method will accept an array as the first parameter , The value provided by the parameter will be used for user data stored in the database
1. Use id The value of the field is searched in the database
1. If the user is found :
First pass the parameter password Hash the value \Hash:make() encryption , And then with the password Match encrypted
If the two values are the same , A session will be created for authenticated users
2. Return for finding false
边栏推荐
- High number_ Chapter 4__ Curvilinear integral_ Exercise solution
- setup和hold timing分析不满足是解决方法
- Information system project manager (2022) - key content: organization level project management, process management, project set management (18)
- Practice and thinking of AI standardization engine in pink client
- 【sylar】框架篇-Chapter12-ByteArray 模块
- Idea2022 change the local warehouse and configure Alibaba cloud central warehouse
- pytorch_ Lightning in lightning_ The output of hparams.yaml in logs is null
- Full resolution of the use of go native plug-ins
- Solana's "deceptive behavior": making mobile phones and opening stores
- Glusterfs file is not mounted, permission: R-S
猜你喜欢

idea启动项目mvn命令终端用不了法将“mvn”项识别为 cmdlet

Seamless support for hugging face community, colossal AI low-cost and easy acceleration of large model

How to select reliable securities analysts?

Important SQL server functions - numeric functions

Power consumption: leakage power

Information system project manager (2022) - key content: Information System Security Management (20)

【YOLOv5实战5】基于YOLOv5的交通标志识别系统-YOLOv5整合PyQt5

重要的 SQL Server 函数 - 字符串实用程序

Study of the Intel aria 10 Avalon mm DMA interface for PCI Express solutions User Guide

《Intel Arria 10 Avalon-MM DMA Interface for PCI Express Solutions User Guide》文档学习
随机推荐
How to upgrade a pair of 12.2 RAC(primary) and a pair of 12.2 RAC(dataguard) to 19c
idea启动项目mvn命令终端用不了法将“mvn”项识别为 cmdlet
Kingbasees Security Guide for Jincang database -- 4 data access protection
Notes to subject 2
High number_ Chapter 4__ curvilinear integral
【牛客】求1+2+3+...+n
Citrix virtual desktop tcp/udp transmission protocol switching
mysql分区表改造
What to do when encountering slow SQL? (next)
方舟生存进化自建服务器要多少成本?
transform: failed to synchronize: cudaErrorAssert: device-side assert triggered
Null security and exception
[blood vessel detection] Based on MATLAB mom method, combined with Hessian and curve fitting, blood vessel diameter measurement [including Matlab source code, 1970]
How much does it cost to build a self built server for ark survival evolution?
.net upload files through boundary
Reading the paper "learning span level interactions for aspect sentimental triple extraction"
Cloud native Devops status survey questionnaire solicitation: kodelurover launched jointly with oschina
Detailed explanation of pl/sql parameters ("box model")
Information system project manager (2022) - key content: Strategic Management (17)
重要的 SQL Server 函数 - 数字函数