[setup][page.noauth.login] added API/WS instances + defined urls
This commit is contained in:
parent
22130a4b0b
commit
778984239b
|
@ -107,10 +107,7 @@ gs.get.login.func.login = function(){
|
||||||
if( errors )
|
if( errors )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* (3) Create API instance */
|
/* (3) API bindings */
|
||||||
let api = new xhrcd('douscord-srv.xdrm.io');
|
|
||||||
|
|
||||||
/* (4) API bindings */
|
|
||||||
api.onreceive = function(_response){
|
api.onreceive = function(_response){
|
||||||
|
|
||||||
// manage error
|
// manage error
|
||||||
|
@ -125,7 +122,7 @@ gs.get.login.func.login = function(){
|
||||||
|
|
||||||
api.onclose = function(){ return gs.get.router.push('register'); };
|
api.onclose = function(){ return gs.get.router.push('register'); };
|
||||||
|
|
||||||
/* (5) API call */
|
/* (4) API call */
|
||||||
api.send({
|
api.send({
|
||||||
path: 'POST /user/token',
|
path: 'POST /user/token',
|
||||||
http_token: encodeURI(`${username}:${password}`)
|
http_token: encodeURI(`${username}:${password}`)
|
||||||
|
|
|
@ -22,6 +22,10 @@ window.auth = new Authentication();
|
||||||
window.xhrcd = XHRClientDriver;
|
window.xhrcd = XHRClientDriver;
|
||||||
window.wscd = WebSocketClientDriver;
|
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
|
/* (2) Global data
|
||||||
|
|
Loading…
Reference in New Issue