auth_tokens.js
// Get request token by auth-token and secret
Get request token by auth-token and secret
Get request token by auth - token and secret
function retrive_rtoken_by_atoken(atoken, secret) {
    if (atoken == null || secret == null) {
        return null;
    }
    if (auth_tokens_records[atoken] == null) {
        return null;
    }
    else {
        TODO: make use of secret
         auth-token valid
        rtoken = auth_tokens_records[atoken].rtoken;
         Decrease counter by 1
        auth_tokens_records[atoken].total = auth_tokens_records[atoken].total - 1;
         Used up token, remove it
        if (auth_tokens_records[atoken].total == 0) {
            delete auth_tokens_records[atoken];
        }
         Return it
        return rtoken;
    }
}
function retrive_rtoken_by_atoken ( atoken , secret ) { if ( atoken == null || secret == null ) { return null ; } if ( auth_tokens_records [ atoken ] == null ) { return null ; } else { rtoken = auth_tokens_records [ atoken ] . rtoken ; auth_tokens_records [ atoken ] . total = auth_tokens_records [ atoken ] . total - 1 ; if ( auth_tokens_records [ atoken ] . total == 0 ) { delete auth_tokens_records [ atoken ] ; } return rtoken ; } }
Get request token by auth-token and secret
Get request token by auth - token and secret
// No such auth-token // //TODO: make use of secret // // auth-token valid // Decrease counter by 1 // Used up token, remove it // Return it