member_webapp/@overflow/member/service/member-totp.service.ts
crusader d59d9379f9 ing
2018-05-24 15:44:13 +09:00

33 lines
1.0 KiB
TypeScript

import { Injectable } from '@angular/core';
import { RPCService } from '@loafer/ng-rpc';
import { Observable } from 'rxjs/Observable';
import { MemberTotp } from '@overflow/commons-typescript/model/member';
import { Member } from '@overflow/commons-typescript/model/member';
@Injectable()
export class MemberTotpService {
public constructor(
private rpcService: RPCService,
) {
}
public createTotp(member: Member): Observable<MemberTotp[]> {
return this.rpcService.call<MemberTotp[]>('MemberTotpService.createTotp', member);
}
public regist(member: Member, secretCode: string, code: string): Observable<boolean> {
// const param = {
// Member: {id: 1, },
// MemberTotp: {id: 1, secretCode: 'dkdkdkdk'},
// code: '123123'
// };
return this.rpcService.call<boolean>('MemberTotpService.regist', member, secretCode, code);
}
public checkCodeForMember(member: Member, code: string): Observable<boolean> {
return this.rpcService.call<boolean>('MemberTotpService.checkCodeForMember', member, code);
}
}