providers/line
LineProfile
繼承
Record
<string
,any
>
屬性
amr
amr: string[];
aud
aud: string;
exp
exp: number;
iat
iat: number;
iss
iss: string;
name
name: string;
picture
picture: string;
sub
sub: string;
user
user: any;
default()
default<P>(options): OAuthConfig<P>
將 LINE 登入新增至您的頁面。
設定
回呼網址
https://example.com/api/auth/callback/line
組態設定
import { Auth } from "@auth/core"
import LINE from "@auth/core/providers/line"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
LINE({ clientId: LINE_CLIENT_ID, clientSecret: LINE_CLIENT_SECRET }),
],
})
資源
組態設定
在 https://developers.line.biz/console/ 建立提供者和 LINE 登入頻道。在 LINE 登入下,頻道設定中,啟用 Web 應用程式並設定以下內容:回呼網址 https://127.0.0.1:3000/api/auth/callback/line
注意事項
預設情況下,Auth.js 假設 LINE 提供者是以 Open ID Connect 規格為基礎。
💡
若要擷取電子郵件地址,您需要申請電子郵件地址權限。開啟 Line 開發人員主控台,前往您的登入頻道。向下捲動到底部找到 OpenID Connect -> 電子郵件地址權限。按一下 申請 並依照指示操作。
💡
LINE 提供者帶有預設組態。若要覆寫您使用案例的預設值,請查看自訂內建 OAuth 提供者。
類型參數
類型參數 |
---|
P 繼承 LineProfile |
參數
參數 | 類型 |
---|---|
選項 | OAuthUserConfig <P > |
回傳
OAuthConfig
<P
>