Selaa lähdekoodia

Send email change requests to new address

tags/v0.1.0
Immanuel Onyeka 3 vuotta sitten
vanhempi
commit
f7548a49fb
6 muutettua tiedostoa jossa 15 lisäystä ja 3 poistoa
  1. +1
    -0
      app/Http/Controllers/OrderController.php
  2. +2
    -1
      app/Http/Controllers/UserController.php
  3. +1
    -0
      app/Models/User.php
  4. +5
    -1
      app/Notifications/ChangeEmail.php
  5. +1
    -0
      resources/js/panel/services.vue
  6. +5
    -1
      resources/js/panel/settings.vue

+ 1
- 0
app/Http/Controllers/OrderController.php Näytä tiedosto

@@ -31,6 +31,7 @@ class OrderController extends Controller
if ($cost > $user->credits) {
abort(520, 'Insufficient Credits');
}

$user->save();
$order->save();
}


+ 2
- 1
app/Http/Controllers/UserController.php Näytä tiedosto

@@ -116,7 +116,8 @@ class UserController extends Controller
$link = URL::temporarySignedRoute('reset-email', now()->addDays(30),
['user' => Auth::user()->id, 'email' => $request->email]);

Auth::user()->notify(new ChangeEmail($link));
Auth::user()->notify(new ChangeEmail($link,
$request->email));


}


+ 1
- 0
app/Models/User.php Näytä tiedosto

@@ -51,4 +51,5 @@ class User extends Authenticatable implements MustVerifyEmail
public function transactions() {
return $this->hasMany(Transaction::class);
}

}

+ 5
- 1
app/Notifications/ChangeEmail.php Näytä tiedosto

@@ -12,14 +12,16 @@ class ChangeEmail extends Notification
use Queueable;

private $link;
private $email;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($link)
public function __construct($link, $email)
{
$this->link = $link;
$this->email = $email;
}

/**
@@ -44,6 +46,7 @@ class ChangeEmail extends Notification
return (new MailMessage)
->line('An email change has been requested. Please confirm your new address by clicking the link below.')
->action('Confirm', $this->link)
->to($this->email)
->line('If you do not recognize this activity, please disregard this email.');
}

@@ -59,4 +62,5 @@ class ChangeEmail extends Notification
//
];
}

}

+ 1
- 0
resources/js/panel/services.vue Näytä tiedosto

@@ -101,6 +101,7 @@ function select(service) {
this.amount = service.maximum;
}
this.selected = service
document.getElementById('overlay-error').textContent = ''
}

function cost() {


+ 5
- 1
resources/js/panel/settings.vue Näytä tiedosto

@@ -95,7 +95,11 @@ function changePassword() {
headers: {'Content-Type': 'application/json',
'Accept': 'application/json',
'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 => {
response.json().then(data => {console.log(data)})
if (response.ok) {


Loading…
Peruuta
Tallenna