Created API plugin, moved api_auth to the API plugin
This commit is contained in:
@@ -38,8 +38,6 @@ def setup_plugin():
|
||||
routes = [
|
||||
Route('mediagoblin.plugins.oauth.authorize', '/oauth/authorize',
|
||||
controller='mediagoblin.plugins.oauth.views:authorize'),
|
||||
Route('mediagoblin.plugins.oauth.test', '/api/test',
|
||||
controller='mediagoblin.plugins.oauth.views:api_test'),
|
||||
Route('mediagoblin.plugins.oauth.access_token', '/oauth/access_token',
|
||||
controller='mediagoblin.plugins.oauth.views:access_token')]
|
||||
|
||||
|
||||
@@ -91,15 +91,3 @@ def access_token(request):
|
||||
error_data = {
|
||||
'error': 'Incorrect code'}
|
||||
return Response(json.dumps(error_data))
|
||||
|
||||
|
||||
@pluginapi.api_auth
|
||||
def api_test(request):
|
||||
if not request.user:
|
||||
return exc.HTTPForbidden()
|
||||
|
||||
user_data = {
|
||||
'username': request.user.username,
|
||||
'email': request.user.email}
|
||||
|
||||
return Response(json.dumps(user_data))
|
||||
|
||||
Reference in New Issue
Block a user