2012-05-18 13:54:48 +00:00
|
|
|
module ExtraRoutes
|
|
|
|
def add(map)
|
|
|
|
|
|
|
|
# omniauth
|
2013-07-26 21:45:16 +00:00
|
|
|
map.match '/auth/:provider/callback', :to => 'sessions#create_omniauth',:via => [:post, :get, :puts, :delete]
|
2012-11-22 14:40:36 +00:00
|
|
|
|
2013-02-17 18:28:32 +00:00
|
|
|
# sso
|
2013-07-26 21:45:16 +00:00
|
|
|
map.match '/auth/sso', :to => 'sessions#create_sso', :via => [:post, :get]
|
2013-02-17 18:28:32 +00:00
|
|
|
|
2012-05-18 13:54:48 +00:00
|
|
|
# sessions
|
2013-07-26 21:45:16 +00:00
|
|
|
map.match '/signin', :to => 'sessions#create', :via => :post
|
|
|
|
map.match '/signshow', :to => 'sessions#show', :via => :get
|
|
|
|
map.match '/signout', :to => 'sessions#destroy', :via => [:get, :delete]
|
2012-11-22 14:40:36 +00:00
|
|
|
|
2013-07-26 21:45:16 +00:00
|
|
|
map.match '/api/sessions', :to => 'sessions#list', :via => :get
|
|
|
|
map.match '/api/sessions/:id', :to => 'sessions#delete', :via => :delete
|
2012-05-18 13:54:48 +00:00
|
|
|
end
|
|
|
|
module_function :add
|
2013-07-26 21:45:16 +00:00
|
|
|
end
|