forked from johndavedecano/laragym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added reset password forgot password
- Loading branch information
1 parent
88203df
commit 817cc0f
Showing
19 changed files
with
315 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
|
||
class ForgotPassword extends Notification | ||
{ | ||
/** | ||
* The password reset token. | ||
* | ||
* @var string | ||
*/ | ||
public $token; | ||
|
||
/** | ||
* Create a notification instance. | ||
* | ||
* @param string $token | ||
* @return void | ||
*/ | ||
public function __construct($token) | ||
{ | ||
$this->token = $token; | ||
} | ||
|
||
/** | ||
* Get the notification's channels. | ||
* | ||
* @param mixed $notifiable | ||
* @return array|string | ||
*/ | ||
public function via($notifiable) | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
/** | ||
* Build the mail representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return \Illuminate\Notifications\Messages\MailMessage | ||
*/ | ||
public function toMail($notifiable) | ||
{ | ||
$url = url(config('app.spa_url').'/auth/reset/'.$this->token); | ||
|
||
return (new MailMessage) | ||
->line('You are receiving this email because we received a password reset request for your account.') | ||
->action('Reset Password', $url) | ||
->line('If you did not request a password reset, no further action is required.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
NODE_PATH=src | ||
APP_NAME=Laragym | ||
APP_NAME=LARAGYM | ||
APP_API_URL=http://localhost:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,73 @@ | ||
import React, {Component} from 'react'; | ||
import {Link} from 'react-router-dom'; | ||
import {Button, Form, FormGroup, Label, Input} from 'reactstrap'; | ||
|
||
import withAuth from 'enhancers/withAuth'; | ||
|
||
class Forgot extends Component { | ||
state = {}; | ||
state = { | ||
isLoading: false, | ||
}; | ||
|
||
isStillMounted = false; | ||
|
||
componentDidMount() { | ||
this.isStillMounted = true; | ||
} | ||
|
||
componentWillUnmount() { | ||
this.isStillMounted = false; | ||
} | ||
|
||
onSubmit = async event => { | ||
event.preventDefault(); | ||
this.setState({isLoading: true}); | ||
|
||
await this.props.forgot({ | ||
email: this.email.value, | ||
}); | ||
|
||
this.isStillMounted && this.setState({isLoading: false}); | ||
}; | ||
|
||
render() { | ||
return <div>sdgagsad</div>; | ||
return ( | ||
<div className="card card-login mx-auto mt-5"> | ||
<div className="card-header text-center">Forgot Password</div> | ||
<div className="card-body"> | ||
<Form onSubmit={this.onSubmit}> | ||
<FormGroup> | ||
<div className="form-label-group"> | ||
<Input | ||
innerRef={email => (this.email = email)} | ||
type="email" | ||
id="inputEmail" | ||
className="form-control" | ||
placeholder="Email address" | ||
autoFocus | ||
disabled={this.state.isLoading} | ||
/> | ||
<Label for="inputEmail">Email address</Label> | ||
</div> | ||
</FormGroup> | ||
<Button | ||
disabled={this.state.isLoading} | ||
size="lg" | ||
color="primary" | ||
block | ||
> | ||
{this.state.isLoading ? 'Please Wait...' : 'Recover'} | ||
</Button> | ||
</Form> | ||
<div className="text-center mt-3"> | ||
<Link to="/auth/login" className="d-block small"> | ||
Back To Login | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Forgot; | ||
export default withAuth(Forgot); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.