**What** One problem with local development can be the dependencies management. To mitigate that, transform checks from an instance of to value check as well as harmonize utils function to be part of the class as a static method instead of separate utilities. By using this approach we are not dependent of the origin of the class and therefore it should ease the user experience. **NOTE** As a next step to discuss, we should probably move the interfaces from the interfaces/medusa package to the utils package. Then we can deprecate the interfaces package and remove it at a later time
32 lines
609 B
JavaScript
32 lines
609 B
JavaScript
import BaseService from "./base-service"
|
|
|
|
/**
|
|
* Interface for file connectors
|
|
* @interface
|
|
*/
|
|
class BaseOauthService extends BaseService {
|
|
static _isOauthService = true
|
|
|
|
static isOauthService(obj) {
|
|
return obj?.constructor?._isOauthService
|
|
}
|
|
|
|
constructor() {
|
|
super()
|
|
}
|
|
|
|
generateToken() {
|
|
throw Error("generateToken must be overridden by the child class")
|
|
}
|
|
|
|
refreshToken() {
|
|
throw Error("refreshToken must be overridden by the child class")
|
|
}
|
|
|
|
destroyToken() {
|
|
throw Error("destroyToken must be overridden by the child class")
|
|
}
|
|
}
|
|
|
|
export default BaseOauthService
|