Permalink
Browse files

Slight cleanup and keeping to MVC pattern

  • Loading branch information...
1 parent d77efc0 commit f22fa68407818698d39e20484c1c291589d488d2 @thomseddon committed Feb 17, 2012
Showing with 7 additions and 4 deletions.
  1. +2 −4 Controller/OAuthController.php
  2. +5 −0 View/OAuth/userinfo.ctp
@@ -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';
}
@@ -142,7 +141,6 @@ public function login () {
*/
public function token(){
$this->autoRender = false;
- $this->Security->csrfCheck = false;
try {
$this->OAuth->grantAccessToken();
} catch (OAuth2ServerException $e) {
@@ -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'));
}
/**
View
@@ -0,0 +1,5 @@
+<?php
+
+echo json_encode($user);
+
+?>

0 comments on commit f22fa68

Please sign in to comment.