New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset password #86
Merged
Merged
Reset password #86
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1948411
add reset password page
miguelonga 9cfe83a
Merge branch 'develop' into reset_password
miguelonga 1752af1
add mailer module and reset_password method
miguelonga 9ec9542
resetPassword method on personService
miguelonga 6a4968f
css details
miguelonga aa112b8
i18n
miguelonga File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'pony' | ||
|
||
module Mailer | ||
class << self | ||
def reset_password(user_mail, new_password) | ||
Pony.mail( | ||
:to => user_mail, | ||
:from => "miguelmundiaragones@gmail.com", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cuidado con configuraciones |
||
:subject => "Tu contraseña ha sido cambiada", | ||
:body => "#{user_mail.split("@")[0]} tu nueva contraseña es #{new_password}", | ||
:via => :smtp, | ||
:via_options => { | ||
:address => 'smtp.gmail.com', | ||
:port => '587', | ||
:enable_starttls_auto => true, | ||
:user_name => 'miguelmundiaragones', | ||
:password => ENV["MAIL_PASS"], | ||
:authentication => :plain, # :plain, :login, :cram_md5, no auth by default | ||
:domain => 'localhost' # the HELO domain provided by the client to the server | ||
} | ||
) | ||
end | ||
end | ||
end |
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,38 @@ | ||
|
||
<ion-header> | ||
|
||
<ion-navbar> | ||
<ion-title>{{ 'LOGIN.REMEMBER_PASSWORD.TITLE' | translate }}</ion-title> | ||
</ion-navbar> | ||
|
||
</ion-header> | ||
|
||
|
||
<ion-content padding> | ||
|
||
<form id="login"> | ||
<ion-grid> | ||
<ion-row class="info"> | ||
{{ 'LOGIN.REMEMBER_PASSWORD.INFO' | translate }} | ||
</ion-row> | ||
<ion-row> | ||
<ion-input [(ngModel)]="email" [ngModelOptions]="{standalone: true}" | ||
type="email" | ||
placeholder="Mail"> | ||
</ion-input> | ||
</ion-row> | ||
</ion-grid> | ||
</form> | ||
|
||
<ion-footer> | ||
<ion-row class="buttons"> | ||
<ion-col width-50> | ||
</ion-col> | ||
<ion-col width-50> | ||
<button form="login" (click)="sendResetLink()" ion-button id="log-in" clear full> | ||
Enviar | ||
</button> | ||
</ion-col> | ||
</ion-row> | ||
</ion-footer> | ||
</ion-content> |
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,45 @@ | ||
page-reset-password { | ||
background-color: blue; | ||
ion-content{ | ||
&.content-md, &.content-ios, &.content-wp{ | ||
background-color: map-get($colors, primary); | ||
color: white; | ||
} | ||
} | ||
ion-row{ | ||
&.info{ | ||
margin-bottom: 20px; | ||
font-size: 20px | ||
} | ||
} | ||
ion-input{ | ||
background-color: white; | ||
border-radius: 5px; | ||
color: black; | ||
padding-left: 10px; | ||
} | ||
ion-grid{ | ||
margin-bottom: 50px; | ||
.item-md, .item-ios, .item-wp{ | ||
background-color: map-get($colors, primary); | ||
} | ||
.input-has-focus .label-md[floating], .input-has-value .label-md[floating], | ||
.input-has-focus .label-ios[floating], .input-has-value .label-ios[floating], | ||
.input-has-focus .label-wp[floating], .input-has-value .label-wp[floating], | ||
.item-input .label-md, .item-input .label-ios, .item-input .label-wp{ | ||
color: white; | ||
} | ||
|
||
.item-input .label-md, .item-input .label-ios, .item-input .label-wp{ | ||
color: map-get($colors, primary); | ||
padding-left: 10px; | ||
} | ||
} | ||
ion-footer{ | ||
ion-row{ | ||
button.button-clear{ | ||
color: white; | ||
} | ||
} | ||
} | ||
} |
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,22 @@ | ||
import { Component } from '@angular/core'; | ||
import { NavController } from 'ionic-angular'; | ||
import { PersonService } from '../../providers/person.service'; | ||
|
||
@Component({ | ||
selector: 'page-reset-password', | ||
templateUrl: 'reset-password.html' | ||
}) | ||
export class ResetPassword { | ||
|
||
email: string = "" | ||
|
||
constructor(public navCtrl: NavController, public personService: PersonService) {} | ||
|
||
sendResetLink() { | ||
this.personService.resetPassword(this.email).subscribe( | ||
data => this.navCtrl.pop(), | ||
err => console.log(err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. toast???? |
||
) | ||
} | ||
|
||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llevar esto al modelo Person