1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Password reset e-mai l& fix for button

This commit is contained in:
Benjamin Beganović 2020-10-27 16:04:28 +01:00
parent 99bfadc0dc
commit e78aacdcfc
9 changed files with 104 additions and 8 deletions

View File

@ -17,6 +17,7 @@ use App\Models\CompanyUser;
use App\Models\Filterable;
use App\Models\Language;
use App\Models\Traits\UserTrait;
use App\Notifications\ResetPasswordNotification;
use App\Utils\Traits\MakesHash;
use App\Utils\Traits\UserSessionAttributes;
use App\Utils\Traits\UserSettings;
@ -354,4 +355,15 @@ class User extends Authenticatable implements MustVerifyEmail
->withTrashed()
->where('id', $this->decodePrimaryKey($value))->firstOrFail();
}
/**
* Send the password reset notification.
*
* @param string $token
* @return void
*/
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ResetPasswordNotification extends Notification
{
use Queueable;
public $token;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(string $token)
{
$this->token = $token;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->view('email.auth.password-reset', ['link' => route('password.reset', $this->token)]);
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"/js/app.js": "/js/app.js?id=a33a5a58bfc6e2174841",
"/css/app.css": "/css/app.css?id=fc37092c9a39881e5e2e",
"/css/app.css": "/css/app.css?id=0bd4f816cc00fc0faae6",
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=b0f29d5fdfa492962c22",
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=d7e708d66a9c769b4c6e",
"/js/clients/payment_methods/authorize-ach.js": "/js/clients/payment_methods/authorize-ach.js?id=c73d32c192c36fe44123",

View File

@ -0,0 +1,22 @@
@component('email.template.master', ['design' => 'light'])
@slot('header')
@component('email.components.header', ['p' => '', 'logo' => 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'])
Hello!
@endcomponent
@endslot
You are receiving this email because we received a password reset request for your account.
@component('email.components.button', ['url' => $link, 'show_link' => true])
Reset Password
@endcomponent
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '&copy; InvoiceNinja'])
If youre having trouble clicking the "Reset Password" button, copy and paste the URL below into your web browser:
<a href="{{ $link }}">{{ $link }}</a>
@endcomponent
@endcomponent

View File

@ -1,8 +1,8 @@
<div class="mt-8 text-center">
<p class="text-center sm:text-lg">{{ $slot }}</p>
<div class="mt-8 text-center break-words">
<p class="block text-center text-sm break-words">{{ $slot }}</p>
@isset($url)
<a href="{{ $url }}" class="text-blue-500 hover:text-blue-600">
<a href="{{ $url }}" class="text-blue-500 hover:text-blue-600 mt-4 text-sm break-words">
@isset($url_text)
{!! $url_text !!}
@else

View File

@ -13,11 +13,11 @@ if(!isset($design)) $design = 'light';
<style>
:root {
@if($settings)
@isset($settings)
--primary-color: {{ $settings->primary_color }};
@else
--primary-color: #4caf50;
@endif
@endisset
}
.border-primary {

View File

@ -49,7 +49,7 @@
@enderror
</div>
<div class="mt-5">
<button class="button button-primary button-block">{{ ctrans('texts.complete') }}</button>
<button class="button button-primary button-block bg-blue-600">{{ ctrans('texts.complete') }}</button>
</div>
</form>
</div>

1
tailwind.config.js vendored
View File

@ -4,6 +4,7 @@ module.exports = {
purge: [
'./resources/views/portal/ninja2020/**/*.blade.php',
'./resources/views/email/template/**/*.blade.php',
'./resources/views/email/components/**/*.blade.php',
'./resources/views/themes/ninja2020/**/*.blade.php',
'./resources/views/auth/**/*.blade.php',
'./resources/views/setup/**/*.blade.php'