Can't get showLoginScreen to work

Community based support for the Digium Phone Application Programming Interface (API).

Moderators: jwitt, sruffell, malcolmd, Moderator

Can't get showLoginScreen to work

Postby intellectit » Wed Jun 03, 2015 11:45 pm

Hi,

I've been trying to get auth.showLoginScreen to work. All I get is a blank screen when I run the code. I've broken my code down to its barest essentials, shown below. Any advice on how to get this to work would be appreciated.

Code: Select all
var app = require('app');
app.init();

var authObj = require('auth').Auth;

var auth = new authObj();
if (auth.isLoggedIn()) {
    return auth.showLoginScreen();
}
intellectit
Oldsterisk
 
Posts: 112
Joined: Sun Aug 02, 2009 8:08 am

Re: Can't get showLoginScreen to work

Postby intellectit » Fri Jun 05, 2015 10:22 pm

I got this one to work. The log viewer wasn't working on my browser. So I was flying blind. Once I switched to a new PC the log viewer started to work and I was able to debug the code. See below.

Code: Select all
var app = require('app');
app.init();

var Language = require('localization_language').Language;

var lang = new Language({'langLocale' : 'en_us'});


var authObj = require('auth').Auth;

var auth = new authObj({

    'lang' : lang
});
    auth.logout({
        'callback' : callbackFunction,
    });
    auth.showLoginScreen({
        'callback' : callbackFunction,
    });

   function callbackFunction (){};
intellectit
Oldsterisk
 
Posts: 112
Joined: Sun Aug 02, 2009 8:08 am


Return to Digium Phone API

Who is online

Users browsing this forum: No registered users and 6 guests