#!/usr/bin/perl
use strict;
use lib './lib';
use Web::Authenticate::Digest;
use Web::Authenticate::User::Storage::Handler::SQL;

exit;
my $raw = DBIx::Raw->new(dsn => 'dbi:mysql:test:127.0.0.1:3306', user => 'root', password => 'forget1');
my $storage_handler = Web::Authenticate::User::Storage::Handler::SQL->new(dbix_raw => $raw);

#my $user = $storage_handler->store_user('janiiiner', 'espi9898', {age => 23});
my $user = $storage_handler->store_user('janiiiner', 'espi9898');

#my $user = $storage_handler->load_user('janiiiner', 'espi9898');

print "id " . $user->id;
print "\n";

print "age " . $user->row->{age};
print "\n";

print "pass " . $user->row->{password};
print "\n";

exit;
my $digest = Web::Authenticate::Digest->new;

my $hash =  $digest->generate('password123');
print "$hash\n";

print "\n";
print $digest->validate($hash, 'password123');
print "\n";
