Skip to content

Commit 032524d

Browse files
committed
feat(token)
1 parent b63adb8 commit 032524d

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

app/Http/Controllers/Auth/AuthController.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,7 @@ public function token(Request $request)
6161
$user = $request->user();
6262

6363
$userData = [
64-
'id' => $user?->id,
65-
'name' => $user?->name,
66-
'family' => $user?->family,
67-
'mobile' => $user?->mobile,
68-
'role' => $user?->getRoleNames()->toArray(),
64+
'is_admin' => $user->hasRole('admin'),
6965
];
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-
}
7866
}
7967
}

0 commit comments

Comments
 (0)