generate token in block controller