Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "joe704la"

Yes I did, I tried it two different ways since I am not 100% sure how the typings.d.ts actually works.

I tried it this way.

interface JQuery {
    sessionTimeout(...any): any;
}

and this way...

declare var sessionTimeout: any; //related to session timeout

But still the same error.

@ismcagdas thank you as always for the awesome help. It took a combination of the below code but now its working good.

ngAfterViewInit(): void {
        this.initExternalLoginProviders();
        setTimeout(() => {
            this.tryGoogleLogin();
        }, 100);
    }

One more question. I was trying to switch from having the pop-up window to it redirecting in the same window. I added the uxMode but it just gets into a redirect loop. Would you have any idea how to handle this?

gapi.client.init({
                            clientId: loginProvider.clientId,
                            scope: 'openid profile email',
                            uxMode: 'redirect',
                            redirectUri: AppConsts.appBaseUrl
                        })

@alexanderpilhar, excellent to hear you found a great approach. I am looking forward to take a look at your approach.

Thank you for sharing.

@ismcagdas, I don't think so because in the UI the actual login provider does show up. This is what confuses me so much. It seems like the service is working perfectly. But for whatever reason when I try to call it in either in this.initExternalLoginProviders() in ngOnInit or ngAfterViewInit it doesn't load the providers and I cannot access them in either of those Init's

@alexanderpilhar I have been very interested in something similar but haven't went down the road yet as there is so much I do not need in the project. WHen you get this done, would you mind sharing what libraries caused you the most issues removing or some kind of guide to how you did this?

Thank you

@ismcagdas it is very weird. We don't use multi-tenancy in this app. It is disabled.

No, I copied this into login.component and it didn't work either when I called this.initExternalLoginProviders() in ngOnInit or ngAfterViewInit.

private initExternalLoginProviders() {
        this._tokenAuthService
            .getExternalAuthenticationProviders()
            .subscribe((providers: ExternalLoginProviderInfoModel[]) => {
                this.externalLoginProviders = _.map(providers, p => new ExternalLoginProvider(p));
            });
    }

I tried that as well and this.loginService.externalLoginProviders is still empty for some reason.

@ismcagdas I tried adding some code to the ngOnInit() of the login.component.ts but it doesn't seem to work. Can you take a look at what I am doing and maybe see what I am doing wrong? It seems like the loginService isn't getting initialized. I even tried adding this.loginService.init(); before the loop but that actually created two Google buttons.

ngOnInit(): void {
        for (let provider of this.loginService.externalLoginProviders) {
            if (provider.name === ExternalLoginProvider.GOOGLE) {
                this.googleProvider = provider;
            }
        }
        if (this.googleProvider != null || this.googleProvider != undefined) {
            this.externalLogin(this.googleProvider);
        }
}

Excellent. Thank you.

Showing 51 to 60 of 163 entries