reorganize and cleanup php server code

This commit is contained in:
2026-02-06 13:12:38 +01:00
parent bf2f18f847
commit a6785f26db
3103 changed files with 494 additions and 351462 deletions
@@ -0,0 +1,52 @@
<?php
namespace Vanguard\Services\Auth\TwoFactor\Contracts;
use Illuminate\Contracts\Auth\Authenticatable as BaseAuthenticatable;
interface Authenticatable extends BaseAuthenticatable
{
/**
* Get the e-mail address used for two-factor authentication.
*
* @return string
*/
public function getEmailForTwoFactorAuth();
/**
* Get the country code used for two-factor authentication.
*
* @return string
*/
public function getAuthCountryCode();
/**
* Get the phone number used for two-factor authentication.
*
* @return string
*/
public function getAuthPhoneNumber();
/**
* Set the country code and phone number used for two-factor authentication.
*
* @param integer $countryCode
* @param integer $phoneNumber
*/
public function setAuthPhoneInformation($countryCode, $phoneNumber);
/**
* Get the two-factor provider options in array format.
*
* @return array
*/
public function getTwoFactorAuthProviderOptions();
/**
* Set the two-factor provider options in array format.
*
* @param array $options
* @return void
*/
public function setTwoFactorAuthProviderOptions(array $options);
}
@@ -0,0 +1,47 @@
<?php
namespace Vanguard\Services\Auth\TwoFactor\Contracts;
use Vanguard\Services\Auth\TwoFactor\Contracts\Authenticatable as TwoFactorAuthenticatable;
interface Provider
{
/**
* Determine if the given user has two-factor authentication enabled.
*
* @param Authenticatable $user
* @return bool
*/
public function isEnabled(TwoFactorAuthenticatable $user);
/**
* Register the given user with the provider.
*
* @param Authenticatable $user
*/
public function register(TwoFactorAuthenticatable $user);
/**
* Sends an SMS with a phone verification token.
* @param Authenticatable $user
* @return mixed
*/
public function sendTwoFactorVerificationToken(TwoFactorAuthenticatable $user);
/**
* Determine if the given token is valid for the given user.
*
* @param Authenticatable $user
* @param string $token
* @return bool
*/
public function tokenIsValid(TwoFactorAuthenticatable $user, $token);
/**
* Delete the given user from the provider.
*
* @param Authenticatable $user
* @return bool
*/
public function delete(TwoFactorAuthenticatable $user);
}