Code Duplication    Length = 5-5 lines in 2 locations

projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-jwt.php 2 locations

@@ 142-146 (lines=5) @@
139
140
		// Check if the nbf if it is defined. This is the time that the
141
		// token can actually be used. If it's not yet that time, abort.
142
		if ( isset( $payload->nbf ) && $payload->nbf > ( $timestamp + static::$leeway ) ) {
143
			throw new BeforeValidException(
144
				'Cannot handle token prior to ' . gmdate( DateTime::ISO8601, $payload->nbf )
145
			);
146
		}
147
148
		// Check that this token has been created before 'now'. This prevents
149
		// using tokens that have been created for later use (and haven't
@@ 151-155 (lines=5) @@
148
		// Check that this token has been created before 'now'. This prevents
149
		// using tokens that have been created for later use (and haven't
150
		// correctly used the nbf claim).
151
		if ( isset( $payload->iat ) && $payload->iat > ( $timestamp + static::$leeway ) ) {
152
			throw new BeforeValidException(
153
				'Cannot handle token prior to ' . gmdate( DateTime::ISO8601, $payload->iat )
154
			);
155
		}
156
157
		// Check if this token has expired.
158
		if ( isset( $payload->exp ) && ( $timestamp - static::$leeway ) >= $payload->exp ) {