ronzeidman / ng2-ui-auth

an angular2 repository for authentication based on angular1's satellizer
MIT License
206 stars 64 forks source link

once logged in, The popup is not closed and it shows the redirect url in popup #95

Closed revanthmahesh closed 7 years ago

revanthmahesh commented 7 years ago

in popup.service.js @sahat has added a parameter for pollPopup function which take popup Url and match it with redirect Url and will close the popup when condition pass

ronzeidman commented 7 years ago

You're right, sahat seem to have changed a bit his logic to check the link against the redirectUri instead the document origin. It can be fixed and I'll put it on my list but it might take a while, if you want this fix faster you can send a pull request and I'll merge it asap.

Hesesses commented 7 years ago

I'm also having a problem with the popup - its not closed after the login and shows code param in the url..

revanthmahesh commented 7 years ago

hey, ronzeidman.. i have found the solution for this and it is working for me, please add setTimeout function in event listener and poll popup function (set Time out will keep on checking the popup url and parent document url...if both are matching it allow popup to close), return the poll popup function with redirect url in open(url: string, name: string, options: IPopupOptions) function.. if you could not get this. please ping me at exclusiverevanth@gmail.com, I will send you the file

revanthmahesh commented 7 years ago

By writing a function to handle the user data in poll popup function. which could help the developer to store the user id and token in local storage through by calling popup service in developers application

ronzeidman commented 7 years ago

It is already being done here: https://github.com/ronzeidman/ng2-ui-auth/blob/master/src/popup.service.ts#L83 the interval runs every 50 ms and checks the URL in line 96. It should have worked. I'll be able to clear a day and fix all issues at the beginning of August in the meantime it would help if you send a pull request, it's easier to see the diffs that way.

Hesesses commented 7 years ago

@ronzeidman is this issue related to #112 ?

ronzeidman commented 7 years ago

I guess, but since #112 is in the ionic framework I'm guessing the origin may be a bit different causing this issue, although there are people who are using it in ionic so it can't be a general issue.

ronzeidman commented 7 years ago

closing since there is no activity. If it's still an issue in version npm i ng2-ui-auth@8.0.0-beta.2 please tell me and I will reopen it.