承接 elementworks/jwt-tokens 相关项目开发

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

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

elementworks/jwt-tokens

最新稳定版本:1.0.4

Composer 安装命令:

composer require elementworks/jwt-tokens

包简介

Create JWT tokens

README 文档

README

Create JWT Tokens in Twig.

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require elementworks/jwt-tokens
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for JWT Tokens.

Settings

The only setting is a signing secret. It is recommended to set this using an environment variable.

How to create a JWT Token

First, create a payload as a Twig hash (associative array).

Next, pass this into the Twig function, along with the algorithm (e.g. 'HS256') to create the token:

{% set payload = {
   'name': 'John Doe',
   'company': 'Google',
} %}

{% set token = craft.jwtTokens.createToken(payload, 'HS256') %}

Brought to you by Steve Rowling

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2024-04-02