@expressive-analytics/deep-thought-authentication
Version:
Typescript conversion of Deep Thought Authentication
17 lines (16 loc) • 658 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DTSecureVerifier = void 0;
const deep_thought_service_1 = require("@expressive-analytics/deep-thought-service");
class DTSecureVerifier extends deep_thought_service_1.DTBasicVerifier {
constructor(db) {
super(db);
this.auth_url = "login";
}
verify(action, token) {
if (super.verify(action, token) && this.userID() > 0) // make sure we have a valid user
return true;
throw new deep_thought_service_1.DTHTTPError(278, 'HTTP/1.1 278 Client Redirect', this.auth_url);
}
}
exports.DTSecureVerifier = DTSecureVerifier;