aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Http/Controllers/Auth
diff options
context:
space:
mode:
authorMarvin Borner2018-07-20 13:57:57 +0200
committerMarvin Borner2018-07-20 13:57:57 +0200
commit932d439444f10774bff546923cc0a2e5e2f2857b (patch)
treeef9bcc039d263f929b4f4991881a52a8343c1dfe /app/Http/Controllers/Auth
parentbd04ac097a0a29ba7c48a5f4a46d99ae7d86eea1 (diff)
Rewrite (only for backend/oauth/api use from now on)
Diffstat (limited to 'app/Http/Controllers/Auth')
-rw-r--r--[-rwxr-xr-x]app/Http/Controllers/Auth/ForgotPasswordController.php0
-rw-r--r--[-rwxr-xr-x]app/Http/Controllers/Auth/LoginController.php10
-rw-r--r--[-rwxr-xr-x]app/Http/Controllers/Auth/RegisterController.php51
-rw-r--r--[-rwxr-xr-x]app/Http/Controllers/Auth/ResetPasswordController.php4
4 files changed, 9 insertions, 56 deletions
diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
index 6a247fe..6a247fe 100755..100644
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 87f66d5..b2ea669 100755..100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
-use Illuminate\Http\Request;
class LoginController extends Controller
{
@@ -17,21 +16,16 @@ class LoginController extends Controller
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
- */
+ */
use AuthenticatesUsers;
- protected function authenticated(Request $request, $user)
- {
- return redirect('/keys/cookie/public');
- }
-
/**
* Where to redirect users after login.
*
* @var string
*/
- protected $redirectTo = '/keys/cookie/public';
+ protected $redirectTo = '/home';
/**
* Create a new controller instance.
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index 2994499..e749c07 100755..100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -2,14 +2,11 @@
namespace App\Http\Controllers\Auth;
-use App\Http\Controllers\Controller;
-use App\Jobs\SendVerificationEmail;
use App\User;
-use Illuminate\Auth\Events\Registered;
-use Illuminate\Foundation\Auth\RegistersUsers;
-use Illuminate\Http\Request;
+use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
+use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
@@ -22,7 +19,7 @@ class RegisterController extends Controller
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
- */
+ */
use RegistersUsers;
@@ -31,7 +28,7 @@ class RegisterController extends Controller
*
* @var string
*/
- protected $redirectTo = '/keys/cookie/public';
+ protected $redirectTo = '/home';
/**
* Create a new controller instance.
@@ -66,48 +63,10 @@ class RegisterController extends Controller
*/
protected function create(array $data)
{
- $hashedPassword = Hash::make($data['password']);
- $previousHash = User::select('hash')->orderBy('id', 'desc')->first()->hash;
- $summedHash = Hash::make($previousHash . $data['name'] . $data['email'] . 'password' . $hashedPassword); // Hash::check to verify
-
return User::create([
'name' => $data['name'],
'email' => $data['email'],
- 'password' => $hashedPassword,
- 'prevHash' => $previousHash,
- 'hash' => $summedHash,
- 'email_token' => base64_encode($data['email']),
+ 'password' => Hash::make($data['password']),
]);
}
-
- /**
- * Handle a registration request for the application.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Illuminate\Http\Response
- */
-
- public function register(Request $request)
- {
- $this->validator($request->all())->validate();
- event(new Registered($user = $this->create($request->all())));
- dispatch(new SendVerificationEmail($user));
- return view('confirmEmail');
- }
-
- /**
- * Handle a registration request for the application.
- *
- * @param $token
- * @return \Illuminate\Http\Response
- */
- public function verifyEmail($token)
- {
- $user = User::where('email_token', $token)->first();
- $user->verified = 1;
- if ($user->save()) {
- return view('verificationSuccess', ['user' => $user]);
- }
- }
-
}
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
index f5edc22..cf726ee 100755..100644
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ b/app/Http/Controllers/Auth/ResetPasswordController.php
@@ -16,7 +16,7 @@ class ResetPasswordController extends Controller
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
- */
+ */
use ResetsPasswords;
@@ -25,7 +25,7 @@ class ResetPasswordController extends Controller
*
* @var string
*/
- protected $redirectTo = '/';
+ protected $redirectTo = '/home';
/**
* Create a new controller instance.