Line OAuth provider

OAuth 2.0 integration for Line (v2.1). Provider id is line.

import { line } from "@lucia-auth/oauth/providers";
import { auth } from "./lucia.js";

const lineAuth = line(auth, configs);

line()#

Scopes oidc are profile are always included.

const line: (
	auth: Auth,
	configs: {
		clientId: string;
		clientSecret: string;
		redirectUri: string;
		scope?: string[];
	}
) => LineProvider;
Parameters#
nametypedescriptionoptional
authAuthLucia instance
config.clientIdstringLine OAuth app client id
config.clientSecretstringLine OAuth app client secret
config.redirectUristringan authorized redirect URI
config.scopestring[]an array of scopes
Returns#
typedescription
LineProviderLine provider

Interfaces#

LineAuth#

See OAuth2ProviderAuth.

// implements OAuth2ProviderAuth<LineAuth<_Auth>>
interface LineAuth<_Auth extends Auth> {
	getAuthorizationUrl: () => Promise<readonly [url: URL, state: string]>;
	validateCallback: (code: string) => Promise<LineUserAuth<_Auth>>;
}
Generics#
nameextendsdefault
_AuthAuthAuth

LineTokens#

type LineTokens = {
	accessToken: string;
	accessTokenExpiresIn: number;
	refreshToken: string;
	idToken: string;
};

LineUser#

Add email scope to get LineUser.email.

type LineUser = {
	userId: string;
	displayName: string;
	pictureUrl: string;
	statusMessage: string;
	email: string | null;
};

LineUserAuth#

Extends ProviderUserAuth.

interface LineUserAuth<_Auth extends Auth> extends ProviderUserAuth<_Auth> {
	lineUser: LineUser;
	lineTokens: LineTokens;
}
propertiestypedescription
lineUserLineUserLine user
lineTokensLineTokensAccess tokens etc
Generics#
nameextends
_AuthAuth