承接 tina4components/tina4login 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tina4components/tina4login

Composer 安装命令:

composer require tina4components/tina4login

包简介

This is a package will render a login screen and register screen that work with tina4sso

README 文档

README

To install the module, you can use the following command:

composer require tina4components/tina4login

To use the module the following .env variables are required:

SSO_TOKEN=<Your API Token from the sso protal>
SSO_REDIRECT_URL=<Your redirect URL to you application>
SSO_BASE_TWIG_FILE=tina4Login-base.twig | <The base twig you would like to have the login extend from>

Once you have installed the following routes will be available:

 /tina4/login - Login Page html 
 
 /tina4/register - Register Page html

To see how the module handles the login and register requests you can look at the following code:

Default Request Helper Implementation

To override this functionality you can create your own implementation of the Tina4LoginRequestHandler interface and set it using the Tina4LoginRequestFactory class. As shown in the example below:

<?php

use Tina4Login\Tina4LoginRequestHandler;
use Tina4Login\Tina4LoginRequestFactory;

class CustomLoginRequestHelper implements Tina4LoginRequestHandler
{
    function afterLogin($httpStatus, $responseData): void
    {
        // Custom login logic
    }

    function afterRegister($httpStatus, $responseData): void
    {
        // Custom register logic
    }
}

// Register custom implementation
Tina4LoginRequestFactory::setTina4LoginRequestHandler(new CustomLoginRequestHelper());

After login Response Data will be in the following format:

200 OK

{
  "guuid": "********-****-****-****-************",
  "firstName": "John",
  "lastName": "Doe",
  "email": "example@example.com",
  "dateModified": "26-12-2024 10:12:20",
  "dateCreated": "26-12-2024 10:12:20",
  "token": "eyJhbGciOi...truncated...Bp5ddhQ",
  "refreshToken": "**************",
  "subscription": {
    "applicationId": "1",
    "lastRenewalDate": "26-12-2024 00:00:00",
    "nextBillingInvoiceId": "-1",
    "nextBillingDate": "25-01-2025 00:00:00",
    "status": "Active",
    "subscriptionPackage": {
      "title": "Free",
      "description": "Free subscription package",
      "newPriceEffectiveDate": null,
      "durationDays": null,
      "trailLength": "0",
      "priceHistory": null,
      "currentPricing": {
        "price": "0.00",
        "currency": "ZAR"
      }
    }
  }
}

400 Bad Request

"Invalid email or password"

401 Unauthorized

 "Unauthorized"

After register Response Data will be in the following format:

200 OK - User needs to confirm email before they can login

"Your user has been created be on the lookout for your confirmation email"

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-11-16