Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support activation

  • Loading branch information...
commit a24183082dc4b0406d810fb55cff8ebd7102668f 1 parent 3dbb7ea
@0x6e6562 authored
Showing with 9 additions and 6 deletions.
  1. +9 −0 angdem.rb
  2. +0 −6 config.ru
View
9 angdem.rb
@@ -37,6 +37,15 @@ def protected!
(!unused).to_s
end
+ get '/activate/:code' do
+ begin
+ Activation[params[:code]].delete
+ status 204
+ rescue
+ status 404
+ end
+ end
+
post '/signup/:username/:email/:password' do
timestamp = DateTime.now
user = User.create(id: params[:username],
View
6 config.ru
@@ -29,12 +29,6 @@ DB = Sequel.connect(
# load DB models
Dir['models/*.rb'].each {|file| require "./#{file}"}
-# User.create(id: 'abc',
-# password: 'secret',
-# email: 'foo@bar.com',
-# member_since: DateTime.now)
- #activation_key: SecureRandom.hex(32))
-
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Please sign in to comment.
Something went wrong with that request. Please try again.