Configure backend for PostgreSQL and fix auth password_hash mapping

هذا الالتزام موجود في:
Abdul Kareem
2026-02-16 23:46:16 +03:00
الأصل 749b083a1f
التزام 2a7c74bceb
6 ملفات معدلة مع 8 إضافات و11 حذوفات

عرض الملف

@@ -38,7 +38,7 @@ class AuthController extends Controller
'last_name' => $lastName,
'email' => $validated['email'],
'phone' => $validated['phone'],
'password' => Hash::make($validated['password']),
'password_hash' => Hash::make($validated['password']),
]);
$token = $user->createToken('mobile_token')->plainTextToken;
@@ -66,7 +66,7 @@ public function login(Request $request)
$user = User::where('email', $request->email)->first();
if (!$user || !Hash::check($request->password, $user->password)) {
if (!$user || !Hash::check($request->password, $user->password_hash)) {
return response()->json([
'message' => 'Invalid credentials'
], 401);

عرض الملف

@@ -28,7 +28,7 @@ class User extends Authenticatable
'last_name',
'email',
'phone',
'password',
'password_hash',
];
/**
@@ -37,7 +37,7 @@ class User extends Authenticatable
* @var list<string>
*/
protected $hidden = [
'password',
'password_hash',
'remember_token',
];
@@ -50,7 +50,7 @@ class User extends Authenticatable
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'password_hash' => 'hashed',
];
}