ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
login_response Struct Referencefinal

Response containing authentication result and account information. More...

#include <login_protocol.hpp>

Collaboration diagram for login_response:
Collaboration graph

Public Member Functions

std::vector< std::byte > serialize () const
 Serialize response to bytes.
 

Static Public Member Functions

static std::expected< login_response, comms::messaging::error_code > deserialize (std::span< const std::byte > data)
 Deserialize response from bytes.
 

Public Attributes

bool success = false
 
std::string error_message
 
boost::uuids::uuid account_id
 
std::string username
 
std::string email
 
bool is_admin = false
 
bool password_reset_required = false
 

Detailed Description

Response containing authentication result and account information.

Member Function Documentation

◆ serialize()

std::vector< std::byte > serialize ( ) const

Serialize response to bytes.

Format:

  • 1 byte: success (boolean)
  • 2 bytes: error_message length
  • N bytes: error_message (UTF-8)
  • 16 bytes: account_id (UUID)
  • 2 bytes: username length
  • N bytes: username (UTF-8)
  • 2 bytes: email length
  • N bytes: email (UTF-8)
  • 1 byte: is_admin (boolean)
  • 1 byte: password_reset_required (boolean)