1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00
invoiceninja/app/Http/Requests/Login/LoginRequest.php

62 lines
1.4 KiB
PHP
Raw Normal View History

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2022-04-27 05:20:41 +02:00
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Http\Requests\Login;
use App\Http\Requests\Request;
2022-04-29 00:50:39 +02:00
use App\Http\ValidationRules\Account\BlackListRule;
2022-04-30 03:55:39 +02:00
use App\Http\ValidationRules\Account\EmailBlackListRule;
2022-04-29 00:50:39 +02:00
use App\Utils\Ninja;
class LoginRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
if (Ninja::isHosted()) {
2022-04-30 03:55:39 +02:00
$email_rules = ['required', new BlackListRule, new EmailBlackListRule];
} else {
2022-04-29 00:50:39 +02:00
$email_rules = 'required';
}
2022-04-29 00:50:39 +02:00
return [
2022-04-29 00:50:39 +02:00
'email' => $email_rules,
2022-04-20 23:25:00 +02:00
'password' => 'required|max:1000',
];
}
2022-06-24 03:55:41 +02:00
// public function prepareForValidation()
2022-04-29 00:50:39 +02:00
// {
// $input = $this->all();
2022-04-29 00:50:39 +02:00
// // if(base64_decode(base64_encode($input['password'])) === $input['password'])
// // $input['password'] = base64_decode($input['password']);
2022-04-29 00:50:39 +02:00
// // nlog($input['password']);
2022-04-29 00:50:39 +02:00
// $this->replace($input);
// }
}