🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@cubetool/plugin-auth

Package Overview
Dependencies
Maintainers
9
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubetool/plugin-auth

cube 用户认证插件

latest
npmnpm
Version
1.0.2
Version published
Maintainers
9
Created
Source

cube 用户认证插件

开发者工具用户认证插件,提供本地用户登录、退出功能。

插件功能

可在其他插件中触发相关 events 获取用户认证信息。

EVENT: login

登录,使用示例:

const authPluginInstalled = ctx.emit('@cubetool/plugin-auth:login', async (getToken) => {
  const token = await getToken();
});
if(!authPluginInstalled){
  // 提示安装此插件或自行实现用户认证
}

EVENT: logout

退出登录,使用示例:

ctx.emit('@cubetool/plugin-auth:logout');

EVENT: auth

授权,使用示例:

ctx.emit('@cubetool/plugin-auth:auth', token);

CLI 命令

@cubetool/cli 拓展以下子命令:

cubetool login

登录。

cubetool logout

退出。

FAQs

Package last updated on 04 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts