Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 6ee998f

Browse files
committed
🚑 fixed incorrect file types
1 parent 390239a commit 6ee998f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

App/Controllers/UsersController.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ class UsersController extends Controller
2424
// and auth settings
2525
public function login()
2626
{
27-
// requestData is a shortcut method which allows
28-
// you get data passed into a request by key name
29-
// $username = requestData("username");
30-
3127
// From v2, you can also use request()
3228
// You can directly get parameters like this:
3329
// $password = request("password");
@@ -51,7 +47,7 @@ public function login()
5147
// password encoding has been configured in the base controller
5248

5349
// This line catches any errors that MAY happen
54-
if (!$user) request()->throwErr($this->auth->errors());
50+
if (!$user) response()->throwErr($this->auth->errors());
5551

5652
// json is another global shortcut method
5753
// it's shorter than $this->json()
@@ -60,9 +56,9 @@ public function login()
6056

6157
public function register()
6258
{
63-
// $username = requestData("username");
64-
// $email = requestData("email");
65-
// $password = requestData("password");
59+
// $username = request("username");
60+
// $email = request("email");
61+
// $password = request("password");
6662

6763
// You can also directly pick vars from the request object
6864
$credentials = request(["username", "email", "password"]);
@@ -75,7 +71,7 @@ public function register()
7571
]);
7672

7773
// Throws an error if there's an issue in validation
78-
if (!$validation) request()->throwErr($this->form->errors());
74+
if (!$validation) response()->throwErr($this->form->errors());
7975

8076
// Direct registration with Leaf Auth. Registers and initiates a
8177
// login, so you don't have to call login again, unless you want
@@ -86,7 +82,7 @@ public function register()
8682
]);
8783

8884
// throw an auth error if there's an issue
89-
if (!$user) request()->throwErr($this->auth->errors());
85+
if (!$user) response()->throwErr($this->auth->errors());
9086

9187
response($user);
9288
}

0 commit comments

Comments
 (0)