Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
feat(email-verification): added method in userService to send email v…
Browse files Browse the repository at this point in the history
…erification link to a user (#108)

* feat(email-verification): added method in userService to send email verification link to a user

* fix(email-verification): updated stricter type checks
  • Loading branch information
rohitkrai03 authored and joshuawilson committed Apr 23, 2018
1 parent 468e66d commit 2b2e030
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/app/user/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable, Inject } from '@angular/core';
import { Headers, Http } from '@angular/http';
import { Headers, Http, Response } from '@angular/http';

import {
Observable,
Expand Down Expand Up @@ -182,7 +182,18 @@ export class UserService {
.get( `${this.usersUrl}?filter[username]=${username}`, { headers: this.headers })
.map(response => {
return response.json().data as User[];
})
});
}

/**
* Send email verification link to user.
*/
sendEmailVerificationLink(): Observable<Response> {
return this.http
.post(this.usersUrl + '/verificationcode', '', { headers: this.headers })
.map((response: Response) => {
return response;
});
}

/**
Expand Down

0 comments on commit 2b2e030

Please sign in to comment.