From 118d9ab5c9f4d7a82b7cf24774ef12d3c221f8ef Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 5 Oct 2012 13:59:39 +0200 Subject: moving to ruby_srp 0.1.0, works with python srp --- users/app/models/user.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'users/app/models/user.rb') diff --git a/users/app/models/user.rb b/users/app/models/user.rb index 95ee810..a6aab84 100644 --- a/users/app/models/user.rb +++ b/users/app/models/user.rb @@ -1,7 +1,5 @@ class User < CouchRest::Model::Base - include SRP::Authentication - property :login, String, :accessible => true property :email, String, :accessible => true property :password_verifier, String, :accessible => true @@ -38,6 +36,10 @@ class User < CouchRest::Model::Base super(options.merge(:only => ['login', 'password_salt'])) end + def initialize_auth(aa) + return SRP::Session.new(self, aa) + end + def salt password_salt.hex end @@ -46,6 +48,10 @@ class User < CouchRest::Model::Base password_verifier.hex end + def username + login + end + def self.current Thread.current[:user] end -- cgit v1.2.3