summaryrefslogtreecommitdiff
path: root/users/config
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-02-26 11:42:19 +0100
committerAzul <azul@leap.se>2013-02-26 11:45:56 +0100
commit4a92bab4d8c231a17a14afc81c391f9a1f91c063 (patch)
treeb877619594eac3ef37abc25df2586e0f9f6fe1f9 /users/config
parent389ddf51ef854c6cfa9541c717c857a8563766e4 (diff)
api for sessions fixed
* now we return the user id on login * allow a destroy request for logging out * added test for api sessions controller
Diffstat (limited to 'users/config')
-rw-r--r--users/config/routes.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/users/config/routes.rb b/users/config/routes.rb
index 2cd1740..c50cb15 100644
--- a/users/config/routes.rb
+++ b/users/config/routes.rb
@@ -1,17 +1,18 @@
Rails.application.routes.draw do
constraints :subdomain => "api" do
- namespace "api", { module: "V1",
+ namespace "api", { module: "v1",
path: "/1/",
defaults: {format: 'json'} } do
- resources :sessions, :only => [:new, :create, :update, :destroy]
+ resources :sessions, :only => [:new, :create, :update]
+ delete "logout" => "sessions#destroy", :as => "logout"
resources :users, :only => [:create, :update]
end
end
get "login" => "sessions#new", :as => "login"
- get "logout" => "sessions#destroy", :as => "logout"
- resources :sessions, :only => [:new, :create, :update, :destroy]
+ delete "logout" => "sessions#destroy", :as => "logout"
+ resources :sessions, :only => [:new, :create, :update]
get "signup" => "users#new", :as => "signup"
resources :users do