MantisBase v0.4.9
Loading...
Searching...
No Matches
mb::MbAuthMethods Struct Reference

#include <auth_methods.h>

Public Member Functions

nlohmann::json toJSON () const
void mergeStrict (const nlohmann::json &auth)

Static Public Member Functions

static MbAuthMethods fromJSON (const nlohmann::json &auth)

Public Attributes

bool password = true
bool otp = false
bool oauth = false
bool requireEmailVerification = false

Detailed Description

@brief Which login methods an auth entity accepts.

Password login is enabled by default. Email OTP and OAuth are disabled until an admin turns them on through the entity schema. requireEmailVerification defaults off so existing accounts can still sign in.

Member Function Documentation

◆ fromJSON()

MbAuthMethods mb::MbAuthMethods::fromJSON ( const nlohmann::json & auth)
inlinestaticnodiscard

Overlay booleans from an auth object. Invalid values are ignored.

◆ mergeStrict()

void mb::MbAuthMethods::mergeStrict ( const nlohmann::json & auth)
inline

Merge a strict auth object into this value. Unknown keys and non-booleans throw MbException 400. Omitted keys keep their current value.

◆ toJSON()

nlohmann::json mb::MbAuthMethods::toJSON ( ) const
inlinenodiscard

Member Data Documentation

◆ oauth

bool mb::MbAuthMethods::oauth = false

◆ otp

bool mb::MbAuthMethods::otp = false

◆ password

bool mb::MbAuthMethods::password = true

◆ requireEmailVerification

bool mb::MbAuthMethods::requireEmailVerification = false

The documentation for this struct was generated from the following file:
  • /home/runner/work/mantisbase/mantisbase/include/mantisbase/core/models/auth_methods.h