Class: Notee::TokensController

Inherits:
ApplicationController show all
Defined in:
app/controllers/notee/tokens_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#restrict_access_json, #set_request_filter

Instance Method Details

#createObject



11
12
13
14
# File 'app/controllers/notee/tokens_controller.rb', line 11

def create
  User.(params[:id], params[:password])
  redirect_to root_path
end

#destroyObject



16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/notee/tokens_controller.rb', line 16

def destroy
  respond_to do |format|
    if @token = Token.find_by_access_token(session[:access_token]).destroy!
      session.delete(:access_token)
      format.json { render json: @token, status: 200 }
      else
      format.json { render json: @token.errors, status: :unprocessable_entity }
    end
  end
end

#newObject



8
9
# File 'app/controllers/notee/tokens_controller.rb', line 8

def new
end