mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-15 20:47:46 +02:00
refactor(auth): replace myth/auth with codeigniter/shield + define new roles
closes #222
This commit is contained in:
parent
c760acc79d
commit
c1287cbe6c
213 changed files with 3366 additions and 3204 deletions
36
modules/Auth/Controllers/InteractController.php
Normal file
36
modules/Auth/Controllers/InteractController.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Auth\Controllers;
|
||||
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
|
||||
/**
|
||||
* Class ActionController
|
||||
*
|
||||
* A generic controller to handle Authentication Actions.
|
||||
*/
|
||||
class InteractController extends Controller
|
||||
{
|
||||
public function attemptInteractAsActor(): RedirectResponse
|
||||
{
|
||||
$rules = [
|
||||
'actor_id' => 'required|numeric',
|
||||
];
|
||||
|
||||
if (! $this->validate($rules)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', service('validation')->getErrors());
|
||||
}
|
||||
|
||||
helper('auth');
|
||||
|
||||
set_interact_as_actor((int) $this->request->getPost('actor_id'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue