You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
552 B
19 lines
552 B
import type { IAuthStrategy, AuthUser, TokenPair } from "../../types/auth";
|
|
|
|
export abstract class OAuthStrategy implements IAuthStrategy {
|
|
abstract readonly provider: string;
|
|
abstract readonly type: "oauth";
|
|
|
|
abstract authenticate(oauthToken: string): Promise<AuthUser>;
|
|
|
|
async generateTokens(
|
|
user: AuthUser,
|
|
sessionId: string
|
|
): Promise<TokenPair> {
|
|
throw new Error("Use AuthService.generateTokens()");
|
|
}
|
|
|
|
async revokeSession(sessionId: string): Promise<void> {
|
|
throw new Error("Use AuthService.revokeSession()");
|
|
}
|
|
}
|