client: add login flow, publish

This commit is contained in:
Koushik Dutta
2022-06-02 19:25:22 -07:00
parent eb06857181
commit 11f99cfd31
4 changed files with 7 additions and 7 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/client",
"version": "1.0.9",
"version": "1.0.12",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/client",
"version": "1.0.9",
"version": "1.0.12",
"license": "ISC",
"dependencies": {
"@scrypted/rpc": "^1.0.4",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/client",
"version": "1.0.9",
"version": "1.0.12",
"description": "",
"main": "dist/packages/client/src/index.js",
"scripts": {

View File

@@ -4,7 +4,7 @@ import { SocketOptions } from 'engine.io-client';
import * as eio from 'engine.io-client';
import { attachPluginRemote } from '../../../server/src/plugin/plugin-remote';
import { RpcPeer } from '../../../server/src/rpc';
import { IOSocket } from '../../../server/src/io';
import type { IOSocket } from '../../../server/src/io';
import axios, { AxiosRequestConfig } from 'axios';
import https from 'https';
@@ -61,8 +61,8 @@ export async function loginScryptedClient(options: ScryptedLoginOptions) {
};
}
export async function checkScryptedClientLogin(options: ScryptedConnectionOptions) {
let { baseUrl } = options;
export async function checkScryptedClientLogin(options?: ScryptedConnectionOptions) {
let { baseUrl } = options || {};
const url = `${baseUrl || ''}/login`;
const response = await axios.get(url, {
withCredentials: true,

View File

@@ -1,4 +1,4 @@
import { Server, Socket } from "engine.io";
import { Server } from "engine.io";
export type IOServer<T> = {
on(ev: 'connection' | 'drain', fn: (socket: IOSocket & T) => void): IOServer<T>;