()
| 77 | } |
| 78 | |
| 79 | signUp() { |
| 80 | if (getConnectionType() === connectionType.none) { |
| 81 | alert("Groceries requires an internet connection to register."); |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | this.userService.register(this.user) |
| 86 | .subscribe( |
| 87 | () => { |
| 88 | alert("Your account was successfully created."); |
| 89 | this.isAuthenticating = false; |
| 90 | this.toggleDisplay(); |
| 91 | }, |
| 92 | (message) => { |
| 93 | // TODO: Verify this works |
| 94 | if (message.match(/same user/)) { |
| 95 | alert("This email address is already in use."); |
| 96 | } else { |
| 97 | alert("Unfortunately we were unable to create your account."); |
| 98 | } |
| 99 | this.isAuthenticating = false; |
| 100 | } |
| 101 | ); |
| 102 | } |
| 103 | |
| 104 | forgotPassword() { |
| 105 | prompt({ |
no test coverage detected