Revision 60220
Added by Argiro Kokogiannaki about 3 years ago
connectSubscriber.guard.ts | ||
---|---|---|
5 | 5 |
import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; |
6 | 6 |
import {SubscribeService} from "../../utils/subscribe/subscribe.service"; |
7 | 7 |
import {properties} from "../../../../environments/environment"; |
8 |
import {ConnectHelper} from "../connectHelper"; |
|
8 | 9 |
|
9 | 10 |
@Injectable() |
10 | 11 |
export class ConnectSubscriberGuard implements CanActivate { |
... | ... | |
14 | 15 |
|
15 | 16 |
check(community: string, path: string): Observable<boolean> { |
16 | 17 |
let errorCode = LoginErrorCodes.NOT_SUBSCRIBER; |
18 |
let communityDomain = ConnectHelper.getCommunityFromDomain(properties.domain); |
|
19 |
if (communityDomain) { |
|
20 |
community = communityDomain; |
|
21 |
} |
|
17 | 22 |
return this.subscribeService.isSubscribedToCommunity(properties, community).pipe(take(1), tap(subscribed =>{ |
18 | 23 |
if(!subscribed){ |
19 | 24 |
this.router.navigate(['/user-info'], { |
Also available in: Unified diff
[Connect|Trunk]
- connect subscriber: fix previous commit - revert reading community from domain