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
)
45 void AuthToken::GenerateToken()
51 for( int i
=0; i
<tokenLen
; i
++ )
53 // 49: Start from 1 (0 is too similar to O)
55 // 7: Hole between 9 and A
56 // 6: Hole between Z and a
57 char c
= rand() % ( 122 - 49 - 7 - 6 );
67 g_log
->Print( std::string( "New token: " ) + m_token
);
70 bool AuthToken::TokenExists()