fix a bug with creating new accounts
This commit is contained in:
parent
b41ad5af4b
commit
bad2991b5e
|
@ -47,7 +47,10 @@ module.exports = ( fastify, opts, done ) => {
|
|||
|
||||
let account = await accounts.AsyncGetPlayerByID( request.query.id )
|
||||
if ( !account ) // create account for user
|
||||
account = await accounts.AsyncCreateAccountForID( request.query.id )
|
||||
{
|
||||
await accounts.AsyncCreateAccountForID( request.query.id )
|
||||
account = await accounts.AsyncGetPlayerByID( request.query.id )
|
||||
}
|
||||
|
||||
let authToken = crypto.randomBytes( 16 ).toString( "hex" )
|
||||
accounts.AsyncUpdateCurrentPlayerAuthToken( account.id, authToken )
|
||||
|
|
Loading…
Reference in New Issue