Skip to content

Commit

Permalink
Improved PIN code input interface
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-oauth-get-access-token): reject
invalid PIN code input and strip extra white spaces.
  • Loading branch information
hayamiz committed Jun 8, 2010
1 parent 78dff77 commit e66125c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2010-06-09 Yuto Hayamizu <y.hayamizu@gmail.com>

* twittering-mode.el (twittering-oauth-get-access-token): reject
invalid PIN code input and strip extra white spaces.

2010-06-05 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: confirm that a valid access token has been
Expand Down
8 changes: 7 additions & 1 deletion twittering-mode.el
Expand Up @@ -1306,7 +1306,13 @@ like following:
(browse-url authorize-url)
(when (y-or-n-p "Open authorization URL with browser? (using `browse-url')")
(browse-url authorize-url)))
(let* ((pin (read-string "Input PIN code: "))
(let* ((pin
(block pin-input-block
(while t
(let ((pin-input (read-string "Input PIN code: ")))
(when (string-match "^\\s-*\\([0-9]+\\)\\s-*$" pin-input)
(return-from pin-input-block
(match-string 1 pin-input)))))))
(verifier pin))
(twittering-oauth-exchange-request-token
access-token-url
Expand Down

0 comments on commit e66125c

Please sign in to comment.