does domain/login?username=???&password=??? still work for 2025?
You may read Login Link.
Ok. So if I have a custom login form, can I authenticate user and redirect user to login link instead of sending the user the login link?
You may, if you see fit, it is your own decision about how to provide the login link to your user. However, if you can authenticate the user and redirect, then you can also login the user directly, e.g. Security()->loginUser($user). You may want to review if it is necessary to use login link.
thanks.
so I assumed $user is username is Users table.
I tried the following from custom page:
<?php
namespace PHPMaker2025\KOMODO;
use DI\ContainerBuilder;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Container\ContainerInterface;
use Psr\Cache\CacheItemPoolInterface;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Result;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Cache\QueryCacheProfile;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Dflydev\FigCookies\FigRequestCookies;
use Dflydev\FigCookies\FigResponseCookies;
use Dflydev\FigCookies\SetCookie;
use Slim\Interfaces\RouteCollectorProxyInterface;
use Slim\App;
use League\Flysystem\DirectoryListing;
use League\Flysystem\FilesystemException;
use Closure;
use DateTime;
use DateTimeImmutable;
use DateInterval;
use Exception;
use InvalidArgumentException;
// Autoload
require_once "../vendor/autoload.php";
// Require files
require_once "../src/constants.php";
require_once "../src/config.php";
require_once "../src/phpfn.php";
require_once "../src/userfn.php";
require_once "../custom/functions.php";
$user = "john.doe@example.com";
$result = Security()->loginUser($user);
//echo "stop";
die('aaa');
the results:
Fatal error : Uncaught TypeError: PHPMaker2025\KOMODO\Security(): Return value must be of type PHPMaker2025\KOMODO\AdvancedSecurity, null returned in /var/www/komodocodes.com/public_html/src/phpfn.php:4939 Stack trace: #0 /var/www/komodocodes.com/public_html/custom/inner_shop.php(43): PHPMaker2025\KOMODO\Security() #1 /var/www/komodocodes.com/public_html/shop/index.php(6): include(‘…’) #2 {main} thrown in /var/www/komodocodes.com/public_html/src/phpfn.php on line 4939
Am I using this correctly?
No, $user is the user object, you can get it by: (assume v2025)
$user = LoadUserByIdentifier($username);
Don’t try to include common script yourself. If you do it wrongly (as in your other post), you cannot use the global functions. If your custom file has HTML content to show after logging in the user, you only need to enable Include common files.
If you only login the user and do something without any HTML in response, you better use Route_Action server event.