@@ -31,6 +31,7 @@ class OrderController extends Controller | |||||
if ($cost > $user->credits) { | if ($cost > $user->credits) { | ||||
abort(520, 'Insufficient Credits'); | abort(520, 'Insufficient Credits'); | ||||
} | } | ||||
$user->save(); | $user->save(); | ||||
$order->save(); | $order->save(); | ||||
} | } | ||||
@@ -116,7 +116,8 @@ class UserController extends Controller | |||||
$link = URL::temporarySignedRoute('reset-email', now()->addDays(30), | $link = URL::temporarySignedRoute('reset-email', now()->addDays(30), | ||||
['user' => Auth::user()->id, 'email' => $request->email]); | ['user' => Auth::user()->id, 'email' => $request->email]); | ||||
Auth::user()->notify(new ChangeEmail($link)); | Auth::user()->notify(new ChangeEmail($link, | ||||
$request->email)); | |||||
} | } | ||||
@@ -51,4 +51,5 @@ class User extends Authenticatable implements MustVerifyEmail | |||||
public function transactions() { | public function transactions() { | ||||
return $this->hasMany(Transaction::class); | return $this->hasMany(Transaction::class); | ||||
} | } | ||||
} | } |
@@ -12,14 +12,16 @@ class ChangeEmail extends Notification | |||||
use Queueable; | use Queueable; | ||||
private $link; | private $link; | ||||
private $email; | |||||
/** | /** | ||||
* Create a new notification instance. | * Create a new notification instance. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function __construct($link) | public function __construct($link, $email) | ||||
{ | { | ||||
$this->link = $link; | $this->link = $link; | ||||
$this->email = $email; | |||||
} | } | ||||
/** | /** | ||||
@@ -44,6 +46,7 @@ class ChangeEmail extends Notification | |||||
return (new MailMessage) | return (new MailMessage) | ||||
->line('An email change has been requested. Please confirm your new address by clicking the link below.') | ->line('An email change has been requested. Please confirm your new address by clicking the link below.') | ||||
->action('Confirm', $this->link) | ->action('Confirm', $this->link) | ||||
->to($this->email) | |||||
->line('If you do not recognize this activity, please disregard this email.'); | ->line('If you do not recognize this activity, please disregard this email.'); | ||||
} | } | ||||
@@ -59,4 +62,5 @@ class ChangeEmail extends Notification | |||||
// | // | ||||
]; | ]; | ||||
} | } | ||||
} | } |
@@ -101,6 +101,7 @@ function select(service) { | |||||
this.amount = service.maximum; | this.amount = service.maximum; | ||||
} | } | ||||
this.selected = service | this.selected = service | ||||
document.getElementById('overlay-error').textContent = '' | |||||
} | } | ||||
function cost() { | function cost() { | ||||
@@ -95,7 +95,11 @@ function changePassword() { | |||||
headers: {'Content-Type': 'application/json', | headers: {'Content-Type': 'application/json', | ||||
'Accept': 'application/json', | 'Accept': 'application/json', | ||||
'X-XSRF-TOKEN': this.token}, | 'X-XSRF-TOKEN': this.token}, | ||||
body: JSON.stringify({'current_password': document.getElementById('current_password').value, 'password': document.getElementById('new_password').value, 'password_confirmation': document.getElementById('confirm_password').value}), | body: JSON.stringify({'current_password': | ||||
document.getElementById('current_password').value, | |||||
'password': document.getElementById('new_password').value, | |||||
'password_confirmation': | |||||
document.getElementById('confirm_password').value}), | |||||
}).then(response => { | }).then(response => { | ||||
response.json().then(data => {console.log(data)}) | response.json().then(data => {console.log(data)}) | ||||
if (response.ok) { | if (response.ok) { | ||||