class Member < ApplicationRecord
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
    belongs_to :user,optional: true
    
    devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,:uid, :confirmable, :lockable

    
    def self.authenticate_session_token(token)
	  	if token.nil? || token.blank? || token.to_s == ' '
	      return false
	    else
	      mem = Member.find_by_session_token(token)
	      if mem.nil?
	        return nil
	      else
	        return mem
	      end
	    end
  	end
end
