providers/mattermost
MattermostProfile
属性
auth_data
auth_data: string;auth_service
auth_service: string;create_at
create_at: number;用户创建的时间(以毫秒为单位)
delete_at
delete_at: number;用户删除的时间(以毫秒为单位)
disable_welcome_email
disable_welcome_email: boolean;电子邮件
email: string;email_verified
email_verified: boolean;first_name
first_name: string;id
id: string;last_name
last_name: string;last_password_update
last_password_update: number;locale
locale: string;nickname
nickname: string;notify_props
notify_props: {
channel: string;
comments: string;
desktop: string;
desktop_sound: string;
desktop_threads: string;
email: string;
email_threads: string;
first_name: string;
mention_keys: string;
push: string;
push_status: string;
push_threads: string;
};channel
channel: string;设置为“true”以启用频道范围内的通知(@channel、@all 等),设置为“false”以禁用。默认设置为“true”。
comments
comments: string;desktop
desktop: string;设置为“all”以接收所有活动的桌面通知,设置为“mention”以仅接收提及和直接消息的通知,设置为“none”以禁用。默认设置为“all”。
desktop_sound
desktop_sound: string;设置为“true”以启用桌面通知的声音,设置为“false”以禁用。默认设置为“true”。
desktop_threads
desktop_threads: string;电子邮件
email: string;设置为“true”以启用电子邮件通知,设置为“false”以禁用。默认设置为“true”。
email_threads
email_threads: string;first_name
first_name: string;设置为“true”以启用对姓名的提及。如果设置了姓,则默认为“true”,否则为“false”。
mention_keys
mention_keys: string;一个用逗号分隔的单词列表,这些单词被视为提及。默认设置为用户名和 @用户名。
push
push: string;设置为“all”以接收所有活动的推送通知,设置为“mention”以仅接收提及和直接消息的通知,设置为“none”以禁用。默认设置为“mention”。
push_status
push_status: string;push_threads
push_threads: string;position
position: string;roles
roles: string;terms_of_service_create_at?
optional terms_of_service_create_at: number;用户接受服务条款的时间(以毫秒为单位)
terms_of_service_id?
optional terms_of_service_id: string;接受的服务条款的 ID(如果有)。如果为空,则此字段不存在。
timezone
timezone: {
automaticTimezone: string;
manualTimezone: string;
useAutomaticTimezone: string;
};automaticTimezone
automaticTimezone: string;当“useAutomaticTimezone”设置为“true”时,此值会自动设置。
manualTimezone
manualTimezone: string;手动设置时区时的值,例如“Europe/Berlin”。
useAutomaticTimezone
useAutomaticTimezone: string;设置为“true”以使用浏览器/系统时区,设置为“false”以手动设置。默认设置为“true”。
update_at
update_at: number;用户最后更新的时间(以毫秒为单位)
username
username: string;default()
default<P>(config): OAuthConfig<P>将 Mattermost 登录添加到您的页面。
设置
回调 URL
https://example.com/api/auth/callback/mattermost配置
import { Auth } from "@auth/core"
import Mattermost from "@auth/core/providers/mattermost"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Mattermost({
clientId: MATTERMOST_CLIENT_ID,
clientSecret: MATTERMOST_CLIENT_SECRET,
issuer: MATTERMOST_ISSUER, // The base url of your Mattermost instance. e.g `https://my-cool-server.cloud.mattermost.com`
}),
],
})资源
备注
默认情况下,Auth.js 假设 Mattermost 提供者基于 OAuth 2 规范。
要创建您的 Mattermost OAuth2 应用,请访问 http://<您的 Mattermost 实例 URL>/<您的团队>/integrations/oauth2-apps
Mattermost 提供者要求设置 issuer 选项。这是您的 Mattermost 实例的基 URL。例如 https://my-cool-server.cloud.mattermost.com
Mattermost 提供程序带有 默认配置。要覆盖您的用例的默认设置,请查看 自定义内置 OAuth 提供程序。
类型参数
| 类型参数 |
|---|
P 扩展 MattermostProfile |
参数
| 参数 | 类型 |
|---|---|
config | OAuthUserConfig<P> & { issuer: string; } |
返回值
OAuthConfig<P>