1 class OauthClientsController < ApplicationController
4 before_filter :authorize_web
5 before_filter :require_user
8 @client_applications = @user.client_applications
9 @tokens = @user.oauth_tokens.find :all, :conditions => 'oauth_tokens.invalidated_at is null and oauth_tokens.authorized_at is not null'
13 @client_application = ClientApplication.new
17 @client_application = @user.client_applications.build(params[:client_application])
18 if @client_application.save
19 flash[:notice] = "Registered the information successfully"
20 redirect_to :action => "show", :id => @client_application.id
22 render :action => "new"
27 @client_application = @user.client_applications.find(params[:id])
28 rescue ActiveRecord::RecordNotFound
29 @type = "client application"
30 render :action => "not_found", :status => :not_found
34 @client_application = @user.client_applications.find(params[:id])
38 @client_application = @user.client_applications.find(params[:id])
39 if @client_application.update_attributes(params[:client_application])
40 flash[:notice] = "Updated the client information successfully"
41 redirect_to :action => "show", :id => @client_application.id
43 render :action => "edit"
48 @client_application = @user.client_applications.find(params[:id])
49 @client_application.destroy
50 flash[:notice] = "Destroyed the client application registration"
51 redirect_to :action => "index"