2018-05-31 10:20:14 +00:00
|
|
|
import { Injectable } from '@angular/core';
|
2018-06-04 08:25:29 +00:00
|
|
|
import { Observable } from 'rxjs';
|
2018-05-31 10:20:14 +00:00
|
|
|
|
|
|
|
import 'rxjs/add/operator/map';
|
|
|
|
|
|
|
|
import { RESTService } from '@loafer/ng-rest';
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class EmailAuthService {
|
|
|
|
|
|
|
|
public constructor(
|
|
|
|
private restService: RESTService,
|
|
|
|
) {}
|
|
|
|
|
|
|
|
public readBySignupAuthKey(token: string): Observable<any> {
|
|
|
|
return this.restService.request<any>('post', '/account/confirm_email', {
|
|
|
|
body: {
|
|
|
|
token: token,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public readByPwAuthKey(token: string): Observable<any> {
|
|
|
|
return this.restService.request<any>('post', '/account/confirm_reset_pw', {
|
|
|
|
body: {
|
|
|
|
token: token,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|