| ... | ... |
@@ -24,4 +24,6 @@ |
| 24 | 24 |
%span.status.icon-record.dnd |
| 25 | 25 |
%a{ href: '#' }
|
| 26 | 26 |
DND |
| 27 |
- %span.icon-arrow-down.drop-down |
|
| 28 | 27 |
\ No newline at end of file |
| 28 |
+ %span.icon-arrow-down.drop-down |
|
| 29 |
+ %a.logout.icon-exit.icon-after{ href: '/logout' }
|
|
| 30 |
+ Logout |
|
| 29 | 31 |
\ No newline at end of file |
| ... | ... |
@@ -129,6 +129,20 @@ |
| 129 | 129 |
top: 2px; |
| 130 | 130 |
font-size: 13px; |
| 131 | 131 |
} |
| 132 |
+ |
|
| 133 |
+ .logout {
|
|
| 134 |
+ left: 158px; |
|
| 135 |
+ font-weight: normal; |
|
| 136 |
+ float: left; |
|
| 137 |
+ margin: 2px; |
|
| 138 |
+ position: absolute; |
|
| 139 |
+ top: 61px; |
|
| 140 |
+ color: $status-color; |
|
| 141 |
+ |
|
| 142 |
+ &:after {
|
|
| 143 |
+ padding-left: 4px; |
|
| 144 |
+ } |
|
| 145 |
+ } |
|
| 132 | 146 |
} |
| 133 | 147 |
|
| 134 | 148 |
h1 input, h2 input {
|
| ... | ... |
@@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base |
| 6 | 6 |
if authenticated? |
| 7 | 7 |
create_new_authentication() |
| 8 | 8 |
|
| 9 |
- unless controller_name == 'chat' |
|
| 9 |
+ if controller_name != 'chat' and (controller_name != 'sessions' and action_name != 'destroy') |
|
| 10 | 10 |
redirect_to chat_path |
| 11 | 11 |
end |
| 12 | 12 |
else |
| ... | ... |
@@ -35,6 +35,12 @@ class ApplicationController < ActionController::Base |
| 35 | 35 |
save_session(user_id, user_credentials) |
| 36 | 36 |
end |
| 37 | 37 |
|
| 38 |
+ def remove_session |
|
| 39 |
+ reset_session() |
|
| 40 |
+ cookies.delete :iv |
|
| 41 |
+ cookies.delete :key |
|
| 42 |
+ end |
|
| 43 |
+ |
|
| 38 | 44 |
private |
| 39 | 45 |
|
| 40 | 46 |
def save_session(user_id, user_credentials) |
| ... | ... |
@@ -1,12 +1,12 @@ |
| 1 | 1 |
Xmpp::Application.routes.draw do |
| 2 |
- get "chat/index" |
|
| 2 |
+ get 'chat/index' |
|
| 3 | 3 |
|
| 4 | 4 |
resources :sessions, only: [:new, :create, :destroy] |
| 5 | 5 |
|
| 6 | 6 |
root :to => 'sessions#new' |
| 7 | 7 |
|
| 8 | 8 |
match '/signin', to: 'sessions#new' |
| 9 |
- match '/signout', to: 'sessions#destroy', via: :delete |
|
| 9 |
+ match '/logout', to: 'sessions#destroy' |
|
| 10 | 10 |
|
| 11 | 11 |
match '/chat', to: 'chat#index' |
| 12 | 12 |
end |