mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
http/server: success/failure message for /oauth
This commit is contained in:
parent
a5164da136
commit
b29f98f64f
2 changed files with 10 additions and 0 deletions
|
@ -178,12 +178,17 @@ case "/static/":
|
||||||
break;
|
break;
|
||||||
case "/oauth":
|
case "/oauth":
|
||||||
object oauth;
|
object oauth;
|
||||||
|
http_ok(version);
|
||||||
//PT((">>> shm: %O\n", shared_memory("oauth_request_tokens")))
|
//PT((">>> shm: %O\n", shared_memory("oauth_request_tokens")))
|
||||||
if (query["oauth_verifier"] && (oauth = shared_memory("oauth_request_tokens")[query["oauth_token"]])) {
|
if (query["oauth_verifier"] && (oauth = shared_memory("oauth_request_tokens")[query["oauth_token"]])) {
|
||||||
//PT((">>> oauth: %O\n", oauth))
|
//PT((">>> oauth: %O\n", oauth))
|
||||||
oauth->verified(query["oauth_verifier"]);
|
oauth->verified(query["oauth_verifier"]);
|
||||||
m_delete(shared_memory("oauth_request_tokens"), query["oauth_token"]);
|
m_delete(shared_memory("oauth_request_tokens"), query["oauth_token"]);
|
||||||
|
write("OAuth succeeded");
|
||||||
|
} else {
|
||||||
|
write("OAuth failed: token not found");
|
||||||
}
|
}
|
||||||
|
quit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
switch (file[1]) {
|
switch (file[1]) {
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* twitter client
|
||||||
|
*
|
||||||
|
* - register @ http://twitter.com/apps
|
||||||
|
* - then in local.h #define TWITTER_KEY & TWITTER_SECRET
|
||||||
|
*/
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
|
||||||
inherit NET_PATH "http/oauth";
|
inherit NET_PATH "http/oauth";
|
||||||
|
|
Loading…
Reference in a new issue