denali-js/denali-auth

View on GitHub

Showing 3 of 3 total issues

Function authenticateRequest has 50 lines of code (exceeds 25 allowed). Consider refactoring.
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`);
      }
Severity: Minor
Found in lib/facets/oauthable.ts - About 2 hrs to fix

    Function authRoutesFor has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function authRoutesFor(modelName: string, router: Router, options: AuthRoutesOptions) {
      options.except = options.except || [];
    
      let Model = router.container.lookup(`model:${ modelName }`);
    
    
    Severity: Minor
    Found in lib/routes-for.ts - About 1 hr to fix

      Function authenticate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      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) {
      Severity: Minor
      Found in lib/facets/authenticatable.ts - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language