public async checkAuthCode()

in web/index.ts [161:189]


    public async checkAuthCode() {

        const code = this.getParameterByName('code');

        if (code) {
            const resp = await axios.default({
                url: `${this.apiUrl}/decode-verify-jwt?code=${code}`,
                method: 'get'
            });

            console.log('decode-verify-jwt response: ' + JSON.stringify(resp, null, 0));

            this.setAuthCookies(resp.data);
            
            // Reload the page
            window.location.href = '/';
        } else {
            if (this.isLoggedIn()) {
                this.setLoginMessage('You are logged in as ' + Cookies.get('username'));

                const user = await this.aapi('userbyusername/' + Cookies.get('username'), 'get');

                const el = document.getElementById('user-data');
                if (el) {
                    el.innerText = JSON.stringify(user, null, 0);
                }
            }
        }
    }