1 class OauthClientsController < ApplicationController
2 before_filter :login_required
5 @client_applications = current_user.client_applications
6 @tokens = current_user.tokens.find :all, :conditions => 'oauth_tokens.invalidated_at is null and oauth_tokens.authorized_at is not null'
10 @client_application = ClientApplication.new
14 @client_application = current_user.client_applications.build(params[:client_application])
15 if @client_application.save
16 flash[:notice] = "Registered the information successfully"
17 redirect_to :action => "show", :id => @client_application.id
19 render :action => "new"
24 @client_application = current_user.client_applications.find(params[:id])
28 @client_application = current_user.client_applications.find(params[:id])
32 @client_application = current_user.client_applications.find(params[:id])
33 if @client_application.update_attributes(params[:client_application])
34 flash[:notice] = "Updated the client information successfully"
35 redirect_to :action => "show", :id => @client_application.id
37 render :action => "edit"
42 @client_application = current_user.client_applications.find(params[:id])
43 @client_application.destroy
44 flash[:notice] = "Destroyed the client application registration"
45 redirect_to :action => "index"