Skip to content

Commit 4328d23

Browse files
committed
✨ started scaffolding support
1 parent a20b34c commit 4328d23

15 files changed

+4
-490
lines changed

App/Controllers/Auth/AccountController.php

Lines changed: 0 additions & 81 deletions
This file was deleted.

App/Controllers/Auth/Controller.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

App/Controllers/Auth/HomeController.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

App/Controllers/Auth/LoginController.php

Lines changed: 0 additions & 79 deletions
This file was deleted.

App/Controllers/Auth/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

App/Controllers/Auth/RegisterController.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

App/Controllers/Controller.php

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,11 @@
11
<?php
22

3-
namespace App\Controllers;
4-
5-
// Leaf Auth is a package which makes user authentication simple
6-
use Leaf\Auth;
7-
use Leaf\Helpers\Password;
3+
namespace App\Controllers\Auth;
84

95
/**
10-
* This is the base controller for your Leaf API Project.
11-
* You can initialize packages or define methods here to use
12-
* them across all your other controllers which extend this one.
6+
* This is a base controller for the auth namespace
137
*/
14-
class Controller extends \Leaf\ApiController
8+
class Controller extends \App\Controllers\Controller
159
{
16-
/** @var \Leaf\Auth */
17-
public $auth;
18-
19-
public function __construct()
20-
{
21-
parent::__construct();
22-
23-
// In this version, request isn't initialised for you. You can use
24-
// requestData() or request() to get request data or initialise it yourself
25-
$this->auth = new Auth;
26-
27-
// autoConnect uses the .env variables to quickly connect to db
28-
$this->auth->autoConnect();
29-
30-
// set default token expiry time
31-
$this->auth->tokenLifetime(60 * 60 * 24 * 365);
32-
33-
// You can configure auth to get additional customizations
34-
// This can be done here with the Auth::config method or
35-
// simply in the Config/auth.php file
36-
$this->auth->config(authConfig("settings"));
37-
38-
// You can refer to https://leafphp.netlify.app/#/leaf/v/2.4/core/auth for auth docs
39-
40-
// New in v2.5. This alloows us to direct our attention
41-
// to session authentication instead of the default API JWT method.
42-
$this->auth->useSession();
43-
}
10+
//
4411
}

App/Controllers/UsersController.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

App/Routes/_users.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

App/Routes/index.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,3 @@
3939
// From v1.1, you can use this Route method anywhere in your app
4040
// This links to the login method of the UsersController
4141
// Route("POST", "/login", "UsersController@login");
42-
43-
// You can define your routes here directly or
44-
// import an independent route file
45-
require "_users.php";

0 commit comments

Comments
 (0)