3 #include "AuthToken.hpp"
12 bool AuthToken::Login( const std::string
& login
)
17 bool AuthToken::Password( const std::string
& login
, const std::string
& password
)
24 if( m_token
== password
)
26 // Token is one time use only
36 std::string
AuthToken::GetRoot( const std::string
& login
)
47 void AuthToken::GenerateToken()
53 for( int i
=0; i
<tokenLen
; i
++ )
55 // 49: Start from 1 (0 is too similar to O)
57 // 7: Hole between 9 and A
58 // 6: Hole between Z and a
59 char c
= rand() % ( 122 - 49 - 7 - 6 );
69 g_log
->Print( std::string( "New token: " ) + m_token
);
72 bool AuthToken::TokenExists()