ichverstehe-chowder 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metadata +1 -1
- data/lib/chowder/helpers/sinatra.rb +0 -28
metadata
CHANGED
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'sinatra/base'
|
2
|
-
|
3
|
-
module Sinatra
|
4
|
-
module Chowder
|
5
|
-
def current_user
|
6
|
-
session[:current_user]
|
7
|
-
end
|
8
|
-
|
9
|
-
def authorized?
|
10
|
-
current_user
|
11
|
-
end
|
12
|
-
|
13
|
-
def login
|
14
|
-
session[:redirect_to] = request.path_info
|
15
|
-
redirect '/login'
|
16
|
-
end
|
17
|
-
|
18
|
-
def logout
|
19
|
-
session[:current_user] = nil
|
20
|
-
end
|
21
|
-
|
22
|
-
def require_user
|
23
|
-
login unless authorized?
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
helpers Chowder
|
28
|
-
end
|