Showing 3 of 3 total issues
Function authenticateRequest
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static authenticateRequest(action: Action, params: any, User: Model) {
debug(`[${ action.request.id }]: attempting to authenticate`);
if (!params.provider) {
throw new Errors.BadRequest(`No OAuth provider was specified, unable to attempt OAuth login`);
}
Function authRoutesFor
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function authRoutesFor(modelName: string, router: Router, options: AuthRoutesOptions) {
options.except = options.except || [];
let Model = router.container.lookup(`model:${ modelName }`);
Function authenticate
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async authenticate(action: Action, params: any, allowedStrategies: string[] | string) {
let failureReason: Error;
let attemptNextStrategy = async (strategies: AuthStrategy[]): Promise<Model> => {
let currentStrategy = strategies.shift();
if (!currentStrategy) {