Skip to content

Instantly share code, notes, and snippets.

@AlexDaSoul
Created January 19, 2020 15:20
Show Gist options
  • Save AlexDaSoul/00fb381d756184e357ee0033057e51e1 to your computer and use it in GitHub Desktop.
Save AlexDaSoul/00fb381d756184e357ee0033057e51e1 to your computer and use it in GitHub Desktop.
nga-28
@Injectable({
providedIn: 'root',
})
export class AuthGrpcService {
constructor(private client: AuthServicePromiseClient) {
}
public auth(data: AuthReq.AsObject): Observable<AuthRes.AsObject> {
const req = new AuthReq();
req.setEmail(data.email);
req.setPassword(data.password);
return grpcUnary<AuthRes.AsObject>(this.client.auth(req));
}
public updateAuth(): Observable<AuthRes.AsObject> {
const req = new Stub();
const meta: Metadata = grpcJwtMetadata();
return grpcUnary<AuthRes.AsObject>(this.client.updateAuth(req, meta));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment