示例#1
0
 getURLFromState: function (state) {
   var thisURL = new URI(this.getLocalURL());
   thisURL.removeQuery('state');
   if (!_.isEmpty(state)) {
     var statesString = JSON.stringify(state);
     thisURL.setQuery('state', statesString);
   }
   return thisURL.toString();
 },
示例#2
0
                    core.storeState(stateObj, function(err, stateTok) {
                        // Construct authorization redirect
                        var uri = new URI(conf['authorization_endpoint']);
                        uri
                            .addQuery({state: stateTok})
                            .addQuery(params)
                            .addQuery({'client_id': resp['client_id']});
                        // Do not send client_secret here
                        uri.removeQuery('client_secret');

                        // Redirect the user to constructed uri
                        return redirect(err, uri && uri.toString());
                    });