Skip to content

Create abstraction for access token related operations in authentication module #2435

@jannyHou

Description

@jannyHou

Description

Create abstraction for token service

  • Create abstraction for token service
// U stands for User model, in this story we can omit it and use `UserProfile` 
export interface Token Service<U extends Model> {}
  • Token service contains
    • generateAccessToken(user: U, options: Object): Promise<string>;
    • serializeAccessToken(response: Response): Promise<void>;
    • extractAccessToken(request: Request): Promise<string>;
    • verifyAccessToken(token: string): Promise<U>;
    • invalidateAccessToken?(token: string): Promise<boolean>;
  • Create unit tests Create Markdown file for acceptance tests (includes investigation of popular token-based authentication strategies and explain how this interface works with them).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions