import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

import { RESTService } from '@loafer/ng-rest';
import { DomainMember } from '@overflow/commons-typescript/model/domain';

@Injectable()
export class AuthService {

  public constructor(
    private restService: RESTService,
  ) {
  }

  public signin_cookie(authToken: string): Observable<DomainMember> {
    return this.restService.request<DomainMember>('post', '/account/signin_cookie', {
      body: {
        authToken: authToken,
      },
    });
  }

}
