[英]Laravel passport: Lcobucci\JWT\Token\InvalidTokenStructure Value is not in the allowed date format
I created a laravel passport to authenticate apps via an api.我创建了一个 laravel 护照来通过 api 验证应用程序。 The setup works local on my machine very well, but when I move the project to the server, I always get the following error: "Lcobucci\JWT\Token\InvalidTokenStructure Value is not in the allowed date format: 1616443683.7318161"该设置在我的机器上本地运行得很好,但是当我将项目移动到服务器时,我总是收到以下错误:“Lcobucci\JWT\Token\InvalidTokenStructure Value is not in the allowed date format: 1616443683.7318161”
The user gets created and the registration throws an error 500 in the following line:用户被创建并且注册在以下行中引发错误 500:
$success['token'] = $user->createToken('appToken')->accessToken;
Registration function注册function
public function register(Request $request)
{
$validator = Validator::make($request->all(), [
'firstname' => 'required',
'lastname' => 'required',
'phone' => 'digits_between:4,30|numeric',
'email' => 'required|email|unique:users',
'password' => 'required',
]);
if ($validator->fails()) {
return response()->json([
'success' => false,
'message' => $validator->errors(),
], 401);
}
$input = $request->all();
$input['password'] = bcrypt($input['password']);
$user = User::create($input);
$success['token'] = $user->createToken('appToken')->accessToken;
return response()->json([
'success' => true,
'token' => $success,
'user' => $user
]);
}
Downgrade Lcobucci\JWT from latest to v3.4将 Lcobucci\JWT 从最新版本降级到 v3.4
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.