Skip to content

Commit

Permalink
Slight cleanup and keeping to MVC pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
thomseddon committed Feb 17, 2012
1 parent d77efc0 commit f22fa68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Controller/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class OAuthController extends OAuthAppController {
*/
public function beforeFilter() {
parent::beforeFilter();
$this->OAuth->allow('test');
$this->OAuth->authenticate = array('fields' => array('username' => 'email'));
$this->Security->blackHoleCallback = 'blackHole';
}
Expand Down Expand Up @@ -142,7 +141,6 @@ public function login () {
*/
public function token(){
$this->autoRender = false;
$this->Security->csrfCheck = false;
try {
$this->OAuth->grantAccessToken();
} catch (OAuth2ServerException $e) {
Expand All @@ -159,9 +157,9 @@ public function token(){
*
*/
public function userinfo() {
$this->autoRender = false;
$this->layout = null;
$user = $this->OAuth->user();
echo json_encode($user);
$this->set(compact('user'));
}

/**
Expand Down
5 changes: 5 additions & 0 deletions View/OAuth/userinfo.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

echo json_encode($user);

?>

0 comments on commit f22fa68

Please sign in to comment.