mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-11 00:24:35 -04:00
* Tests for authentication * Add db field to company table (required if we are doing jobs without an auth()->user() ) * Add Laravel Dusk for browser testing, add ability to set DB by incoming URL Hash
27 lines
557 B
PHP
27 lines
557 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Traits;
|
|
|
|
use App\Models\User;
|
|
|
|
trait VerifiesUserEmail
|
|
{
|
|
|
|
public function confirm($code)
|
|
{
|
|
$user = User::where('confirmation_code', $code)->first();
|
|
|
|
if ($user) {
|
|
|
|
$user->email_verified_at = now();
|
|
$user->confirmation_code = null;
|
|
$user->save();
|
|
|
|
redirect()->route('user.dashboard')->with('message', trans('texts.security_confirmation'));
|
|
|
|
}
|
|
|
|
redirect()->route('login')->with('message', trans('texts.wrong_confirmation'));
|
|
|
|
}
|
|
} |