Skip to content

Commit 9180edb

Browse files
committed
now uses rack_hashed_cookie_session for secure cookie based sessions, also removed random cruft I forgot I had in there
1 parent d77f3be commit 9180edb

File tree

1 file changed

+3
-35
lines changed

1 file changed

+3
-35
lines changed

sinatra_auth.rb

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,14 @@
33
require 'dm-core'
44
require 'dm-timestamps'
55
require 'dm-validations'
6+
require 'rack/session/hashed_cookie'
67
require Pathname(__FILE__).dirname.expand_path + "models/user"
78

89
DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/db/test.db")
910
DataMapper.auto_upgrade!
1011

11-
class FeedLink
12-
include DataMapper::Resource
13-
14-
property :id, Serial
15-
property :url, String
16-
property :title, String
17-
18-
has n, :feed_link_taggings
19-
has n, :feed_link_tags, :through => :feed_link_taggings
20-
end
21-
22-
class FeedLinkTagging
23-
include DataMapper::Resource
24-
25-
property :id, Serial
26-
property :user_id, Integer
27-
28-
belongs_to :feed_link
29-
belongs_to :feed_link_tag
30-
belongs_to :user
31-
end
32-
33-
class FeedLinkTag
34-
include DataMapper::Resource
35-
36-
property :id, Serial
37-
property :name, String
38-
39-
has n, :feed_link_taggings
40-
has n, :feed_links, :through => :feed_link_taggings
41-
end
42-
43-
# change this to memcached
44-
enable :sessions
45-
12+
disable :sessions
13+
use Rack::Session::HashedCookie, :secret => 'A1 sauce 1s so good you should use 1t on a11 yr st34ksssss'
4614

4715
get '/' do
4816
login_required

0 commit comments

Comments
 (0)