Skip to content

Commit f4daf48

Browse files
committed
reset password works
1 parent fe9aba6 commit f4daf48

File tree

3 files changed

+67
-5
lines changed

3 files changed

+67
-5
lines changed

app/auth/auth.component.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component } from '@angular/core';
1+
import { Component, Inject } from '@angular/core';
22
import { Router } from '@angular/router';
33

4-
import { AngularFire, FirebaseAuth, AngularFireAuth } from 'angularfire2';
4+
import { AngularFire, FirebaseApp } from 'angularfire2';
55

66
@Component({
77
templateUrl: 'app/auth/signup.component.html'
@@ -68,11 +68,25 @@ export class LoginComponent {
6868
})
6969

7070
export class ResetpassComponent {
71-
constructor(private af: AngularFire) { }
71+
public auth: any;
72+
public message: any;
73+
constructor(private af: AngularFire, @Inject(FirebaseApp) firebaseApp: any) {
74+
this.auth = firebaseApp.auth()
75+
console.log(this.auth);
76+
}
7277

7378
onSubmit(formData) {
7479
if(formData.valid) {
7580
console.log('Submission worked');
81+
this.auth.sendPasswordResetEmail(formData.value.email)
82+
.then( (response) => {
83+
console.log('Sent successfully');
84+
this.message = 'Check your email for reset link';
85+
})
86+
.catch( (error) => {
87+
this.message = error;
88+
console.log(error);
89+
})
7690
}
7791
}
7892
}

app/auth/resetpassword.component.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
<div class="row">
22
<div class="small-12 medium-8 medium-centered large-6 large-centered columns">
3-
TODO
3+
<div class="callout" *ngIf="message">
4+
{{ message }}
5+
</div>
46
<h2>Reset Password</h2>
57
<form #formData='ngForm' (ngSubmit)="onSubmit(formData)">
68
<div class="row">
79
<div class="small-12 columns">
810
<label> Enter email address
9-
<input type="email" name="email" placeholder="e.g [email protected]" (ngModel)="email" requred>
11+
<input type="email" name="email" placeholder="e.g [email protected]" (ngModel)="email" required>
1012
</label>
1113
</div>
1214
<div class="small-12 columns">
1315
<button type="submit" class="button" [disabled]="!formData.valid">Submit</button>
1416
<br/>
17+
{{ formData.valid }}
1518
<a routerLink="/">Cancel</a>
1619
</div>
1720
</div>

npm-debug.log

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
0 info it worked if it ends with ok
2+
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'start' ]
3+
2 info using [email protected]
4+
3 info using [email protected]
5+
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
6+
5 info lifecycle [email protected]~prestart: [email protected]
7+
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
8+
7 info lifecycle [email protected]~start: [email protected]
9+
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
10+
9 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/khophi/Developments/Firebase/Angular2FireAuth/node_modules/.bin:/usr/bin:/home/khophi/.config/composer/vendor/bin:/home/khophi/.rbenv/plugins/ruby-build/bin:/home/khophi/.rbenv/shims:/home/khophi/.rbenv/bin:/home/khophi/npm-global/bin:/home/khophi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/khophi/Android/Sdk/tools:/home/khophi/Android/Sdk/platform-tools:/home/khophi/.gem/ruby/2.2.0/bin:/home/khophi/Developments/AppEngine:/opt/robomongo/bin/robomongo
11+
10 verbose lifecycle [email protected]~start: CWD: /home/khophi/Developments/Firebase/Angular2FireAuth
12+
11 silly lifecycle [email protected]~start: Args: [ '-c', 'tsc && concurrently "tsc -w" "lite-server" ' ]
13+
12 silly lifecycle [email protected]~start: Returned: code: 2 signal: null
14+
13 info lifecycle [email protected]~start: Failed to exec start script
15+
14 verbose stack Error: [email protected] start: `tsc && concurrently "tsc -w" "lite-server" `
16+
14 verbose stack Exit status 2
17+
14 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
18+
14 verbose stack at emitTwo (events.js:100:13)
19+
14 verbose stack at EventEmitter.emit (events.js:185:7)
20+
14 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
21+
14 verbose stack at emitTwo (events.js:100:13)
22+
14 verbose stack at ChildProcess.emit (events.js:185:7)
23+
14 verbose stack at maybeClose (internal/child_process.js:850:16)
24+
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
25+
15 verbose pkgid [email protected]
26+
16 verbose cwd /home/khophi/Developments/Firebase/Angular2FireAuth
27+
17 error Linux 4.4.0-38-generic
28+
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
29+
19 error node v5.12.0
30+
20 error npm v3.8.6
31+
21 error code ELIFECYCLE
32+
22 error [email protected] start: `tsc && concurrently "tsc -w" "lite-server" `
33+
22 error Exit status 2
34+
23 error Failed at the [email protected] start script 'tsc && concurrently "tsc -w" "lite-server" '.
35+
23 error Make sure you have the latest version of node.js and npm installed.
36+
23 error If you do, this is most likely a problem with the angular-quickstart package,
37+
23 error not with npm itself.
38+
23 error Tell the author that this fails on your system:
39+
23 error tsc && concurrently "tsc -w" "lite-server"
40+
23 error You can get information on how to open an issue for this project with:
41+
23 error npm bugs angular-quickstart
42+
23 error Or if that isn't available, you can get their info via:
43+
23 error npm owner ls angular-quickstart
44+
23 error There is likely additional logging output above.
45+
24 verbose exit [ 1, true ]

0 commit comments

Comments
 (0)