diff --git a/webpack/page/noauth/login.js b/webpack/page/noauth/login.js index c746844..423610f 100644 --- a/webpack/page/noauth/login.js +++ b/webpack/page/noauth/login.js @@ -107,10 +107,7 @@ gs.get.login.func.login = function(){ if( errors ) return false; - /* (3) Create API instance */ - let api = new xhrcd('douscord-srv.xdrm.io'); - - /* (4) API bindings */ + /* (3) API bindings */ api.onreceive = function(_response){ // manage error @@ -125,7 +122,7 @@ gs.get.login.func.login = function(){ api.onclose = function(){ return gs.get.router.push('register'); }; - /* (5) API call */ + /* (4) API call */ api.send({ path: 'POST /user/token', http_token: encodeURI(`${username}:${password}`) diff --git a/webpack/setup.js b/webpack/setup.js index 0d2549d..c110aa2 100644 --- a/webpack/setup.js +++ b/webpack/setup.js @@ -22,6 +22,10 @@ window.auth = new Authentication(); window.xhrcd = XHRClientDriver; window.wscd = WebSocketClientDriver; +/* (4) ClientDriver instances */ +window.api = new XHRClientDriver('api.douscord.xdrm.io'); +window.ws = new WebSocketClientDriver('ws.douscord.xdrm.io'); + /* (2) Global data