Sha256: 9463c83a12899710339dbdb374c2f98c95e1606e2f15f4c045c1bec8c14466f5

Contents?: true

Size: 608 Bytes

Versions: 40

Compression:

Stored size: 608 Bytes

Contents

const emptyPromise=function(e=null){return new Promise((n=>{n(e)}))};class Auth{updateToken(e,n=!1){return localStorage.openc3Token&&!n||(this.clearTokens(),this.login(location.href)),emptyPromise()}setTokens(){}clearTokens(){delete localStorage.openc3Token}login(e){/^\/login/.test(location.pathname)||(location=`/login?redirect=${encodeURI(e)}`)}logout(){this.clearTokens(),location.reload()}user(){return{name:"Anonymous"}}getInitOptions(){}init(){return emptyPromise(!0)}}var OpenC3Auth=new Auth;Object.defineProperty(OpenC3Auth,"defaultMinValidity",{value:30,writable:!1,enumerable:!0,configurable:!1});

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
openc3-tool-base-5.16.0 tools/base/js/auth.js
openc3-tool-base-5.15.2 tools/base/js/auth.js
openc3-tool-base-5.15.1 tools/base/js/auth.js
openc3-tool-base-5.15.0 tools/base/js/auth.js
openc3-tool-base-5.14.2 tools/base/js/auth.js
openc3-tool-base-5.14.1 tools/base/js/auth.js
openc3-tool-base-5.14.0 tools/base/js/auth.js
openc3-tool-base-5.13.0 tools/base/js/auth.js
openc3-tool-base-5.12.0 tools/base/js/auth.js
openc3-tool-base-5.11.3 tools/base/js/auth.js
openc3-tool-base-5.11.2 tools/base/js/auth.js
openc3-tool-base-5.11.1 tools/base/js/auth.js
openc3-tool-base-5.11.0 tools/base/js/auth.js
openc3-tool-base-5.10.1 tools/base/js/auth.js
openc3-tool-base-5.10.0 tools/base/js/auth.js
openc3-tool-base-5.9.1 tools/base/js/auth.js
openc3-tool-base-5.9.0 tools/base/js/auth.js
openc3-tool-base-5.8.1 tools/base/js/auth.js
openc3-tool-base-5.8.0 tools/base/js/auth.js
openc3-tool-base-5.7.2 tools/base/js/auth.js