We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b63adb8 commit 032524dCopy full SHA for 032524d
app/Http/Controllers/Auth/AuthController.php
@@ -61,19 +61,7 @@ public function token(Request $request)
61
$user = $request->user();
62
63
$userData = [
64
- 'id' => $user?->id,
65
- 'name' => $user?->name,
66
- 'family' => $user?->family,
67
- 'mobile' => $user?->mobile,
68
- 'role' => $user?->getRoleNames()->toArray(),
+ 'is_admin' => $user->hasRole('admin'),
69
];
70
-
71
- if ($user) {
72
- return $this->success([
73
- 'user' => $userData,
74
- ], 'Otp is correct');
75
- } else {
76
- return $this->fail(null, 'Otp is incorrect', 404);
77
- }
78
}
79
0 commit comments