• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

damienbod / angular-auth-oidc-client / 8332521723

18 Mar 2024 07:29PM CUT coverage: 92.928% (-4.1%) from 97.057%
8332521723

Pull #1848

github

web-flow
Merge e22aee67b into 6c778a4a2
Pull Request #1848: moving to strict mode

700 of 818 branches covered (85.57%)

Branch coverage included in aggregate %.

228 of 293 new or added lines in 48 files covered. (77.82%)

11 existing lines in 6 files now uncovered.

2559 of 2689 relevant lines covered (95.17%)

8.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.47
/projects/angular-auth-oidc-client/src/lib/utils/flowHelper/flow-helper.service.ts
1
import { Injectable } from '@angular/core';
2
import { OpenIdConfiguration } from '../../config/openid-configuration';
3

4
@Injectable({ providedIn: 'root' })
5
export class FlowHelper {
1✔
6
  isCurrentFlowCodeFlow(configuration: OpenIdConfiguration): boolean {
7
    return this.currentFlowIs('code', configuration);
46✔
8
  }
9

10
  isCurrentFlowAnyImplicitFlow(configuration: OpenIdConfiguration): boolean {
11
    return (
3✔
12
      this.isCurrentFlowImplicitFlowWithAccessToken(configuration) ||
5✔
13
      this.isCurrentFlowImplicitFlowWithoutAccessToken(configuration)
14
    );
15
  }
16

17
  isCurrentFlowCodeFlowWithRefreshTokens(
18
    configuration: OpenIdConfiguration | null
19
  ): boolean {
20
    if (!configuration) {
4!
NEW
21
      return false;
×
22
    }
23

24
    const { useRefreshToken } = configuration;
4✔
25

26
    return (
4✔
27
      this.isCurrentFlowCodeFlow(configuration) && Boolean(useRefreshToken)
5✔
28
    );
29
  }
30

31
  isCurrentFlowImplicitFlowWithAccessToken(
32
    configuration: OpenIdConfiguration
33
  ): boolean {
34
    return this.currentFlowIs('id_token token', configuration);
25✔
35
  }
36

37
  currentFlowIs(
38
    flowTypes: string[] | string,
39
    configuration: OpenIdConfiguration
40
  ): boolean {
41
    const { responseType } = configuration;
77✔
42

43
    if (Array.isArray(flowTypes)) {
77✔
44
      return flowTypes.some((x) => responseType === x);
2✔
45
    }
46

47
    return responseType === flowTypes;
75✔
48
  }
49

50
  private isCurrentFlowImplicitFlowWithoutAccessToken(
51
    configuration: OpenIdConfiguration
52
  ): boolean {
53
    return this.currentFlowIs('id_token', configuration);
2✔
54
  }
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc