fix(AuthToken): Namespace observable methods
This prevents methods that use the regular methods internally from clashing
This commit is contained in:
@ -138,7 +138,7 @@ module.exports = function enableAuthentication(app) {
|
||||
}
|
||||
);
|
||||
}
|
||||
return authToken.validate()
|
||||
return authToken.validate$()
|
||||
.map(isValid => {
|
||||
if (!isValid) {
|
||||
throw wrapHandledError(
|
||||
@ -153,7 +153,7 @@ module.exports = function enableAuthentication(app) {
|
||||
}
|
||||
);
|
||||
}
|
||||
return authToken.destroy();
|
||||
return authToken.destroy$();
|
||||
})
|
||||
.map(() => user);
|
||||
});
|
||||
|
@ -5,10 +5,10 @@ export default function(AuthToken) {
|
||||
AuthToken.findOne$ = Observable.fromNodeCallback(
|
||||
AuthToken.findOne.bind(AuthToken)
|
||||
);
|
||||
AuthToken.prototype.validate = Observable.fromNodeCallback(
|
||||
AuthToken.prototype.validate$ = Observable.fromNodeCallback(
|
||||
AuthToken.prototype.validate
|
||||
);
|
||||
AuthToken.prototype.destroy = Observable.fromNodeCallback(
|
||||
AuthToken.prototype.destroy$ = Observable.fromNodeCallback(
|
||||
AuthToken.prototype.destroy
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user