Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Tumblrログイン修正。 #36

Merged
merged 1 commit into from

2 participants

polygon planet to
polygon planet

TumblrログインのFix

to to merged commit 9c3a337 into from
to
Owner
to commented

いつもお世話になっております。いただきます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 19, 2012
  1. Tumblrログイン修正。

    polygonplanet authored
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 8 deletions.
  1. +17 −8 xpi/chrome/content/library/20_Tumblr.js
25 xpi/chrome/content/library/20_Tumblr.js
View
@@ -337,15 +337,24 @@ var Tumblr = update({}, AbstractSessionService, {
},
login : function(user, password){
+ var LOGIN_FORM_URL = 'https://www.tumblr.com/login';
+ var LOGIN_EXEC_URL = 'https://www.tumblr.com/svc/account/register';
var self = this;
- return request(Tumblr.TUMBLR_URL+'login', {
- sendContent : {
- email : user,
- password : password,
- }
- }).addCallback(function(){
- self.updateSession();
- self.user = user;
+ return Tumblr.logout().addCallback(function(){
+ return request(LOGIN_FORM_URL).addCallback(function(res){
+ var doc = convertToHTMLDocument(res.responseText);
+ var form = doc.getElementById('signup_form');
+ return request(LOGIN_EXEC_URL, {
+ sendContent : update(formContents(form), {
+ 'action' : 'signup_login',
+ 'user[email]' : user,
+ 'user[password]' : password
+ })
+ });
+ }).addCallback(function(){
+ self.updateSession();
+ self.user = user;
+ });
});
},
Something went wrong with that request. Please try again.