abacritt / angularx-social-login

Social login and authentication module for Angular 17
630 stars 388 forks source link

SocialLoginModule is already loaded. Import it in the AppModule only #647

Closed anuj-scanova closed 9 months ago

anuj-scanova commented 1 year ago

When the user visits my website host https://app.example.com, the user is redirected to https://app.example.com/dashboard

But after importing the SocialLoginModule module in the app.module.ts file, the redirect is not happening. Manually entering the whole path in the address bar works fine. On the root URL, it gives an error in the console

Error: Uncaught (in promise): Error: SocialLoginModule is already loaded. Import it in the AppModule only
Error: SocialLoginModule is already loaded. Import it in the AppModule only
    at new U (360.3126bbab9326486f.js:1:612578)
    at U.ɵfac [as useFactory] (360.3126bbab9326486f.js:1:612800)
    at Object.i [as factory] (main.8e60ad18618f6ba3.js:3:366560)
    at Ql.hydrate (main.8e60ad18618f6ba3.js:3:365309)
    at Ql.get (main.8e60ad18618f6ba3.js:3:363880)
    at fu (main.8e60ad18618f6ba3.js:3:352643)
    at ii (main.8e60ad18618f6ba3.js:3:352744)
    at useValue (main.8e60ad18618f6ba3.js:3:362245)
    at Ql.resolveInjectorInitializers (main.8e60ad18618f6ba3.js:3:364740)
    at new gm (main.8e60ad18618f6ba3.js:3:420940)
    at zh.create (main.8e60ad18618f6ba3.js:3:421277)
    at main.8e60ad18618f6ba3.js:3:571460
    at main.8e60ad18618f6ba3.js:3:252580
    at Z._next (main.8e60ad18618f6ba3.js:3:250654)
    at Z.next (main.8e60ad18618f6ba3.js:3:240041)
    at subscribe.Qe (main.8e60ad18618f6ba3.js:3:253278)
    at Z._next (main.8e60ad18618f6ba3.js:3:250654)
    at Z.next (main.8e60ad18618f6ba3.js:3:240041)
    at main.8e60ad18618f6ba3.js:3:248874
    at v.invoke (polyfills.d8efbdf78b051b50.js:1:6581)
    at Object.onInvoke (main.8e60ad18618f6ba3.js:3:438456)
    at v.invoke (polyfills.d8efbdf78b051b50.js:1:6521)
    at M.run (polyfills.d8efbdf78b051b50.js:1:1977)
    at polyfills.d8efbdf78b051b50.js:1:16778
    at v.invokeTask (polyfills.d8efbdf78b051b50.js:1:7199)
    at Object.onInvokeTask (main.8e60ad18618f6ba3.js:3:438272)
    at v.invokeTask (polyfills.d8efbdf78b051b50.js:1:7120)
    at M.runTask (polyfills.d8efbdf78b051b50.js:1:2594)
    at _ (polyfills.d8efbdf78b051b50.js:1:9216)
    at X (polyfills.d8efbdf78b051b50.js:1:15970)
    at X (polyfills.d8efbdf78b051b50.js:1:15505)
    at polyfills.d8efbdf78b051b50.js:1:16815
    at v.invokeTask (polyfills.d8efbdf78b051b50.js:1:7199)
    at Object.onInvokeTask (main.8e60ad18618f6ba3.js:3:438272)
    at v.invokeTask (polyfills.d8efbdf78b051b50.js:1:7120)
    at M.runTask (polyfills.d8efbdf78b051b50.js:1:2594)
    at _ (polyfills.d8efbdf78b051b50.js:1:9216) 'error'

But the module is only imported once in the AuthModule, where the Google-login directive has to be used.

Tried to reproduce it in Stackblitz, but it gives an error.

Stackblitz link: https://stackblitz.com/edit/angular-ivy-4hupbc

oneFoldSoftware commented 1 year ago

you can solve it with a directive...

https://github.com/abacritt/angularx-social-login/issues/563

Heatmanofurioso commented 1 year ago

@anuj-scanova Have you tried the directive solution, or does it not work for you? I'd like to know if we can close this issue or not

oneFoldSoftware commented 1 year ago

Thank you for your message. We will process your request and respond via email within 24 hours.

-- @.*** https://1foldsoftware.com

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

oneFoldSoftware commented 1 year ago

Thank you for your message. We will process your request and respond via email within 24 hours.

-- @.*** https://1foldsoftware.com

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.