eNkru/freelook

Window remains white when redirecting

lhjt opened this issue · 16 comments

lhjt commented

When attempting to sign into my enterprise email using Freelook, after entering my email details, the screen goes white with the title bar Redirecting.... I am not sure if it's because a pop-up window was meant to appear and it can't be seen with the app, or something else.

image

When I log into my email through chrome, it works just fine. Although my company is using a custom mail server, it still uses the Outlook Web app, although I am not sure if that may be unavailable when using Freelook.

The version I am using is pulled directly from GitHub, and then run using yarn run after running yarn. I can have it run in dev mode and take a look, but where are the instructions on how to do that?

eNkru commented

@LOHT03 you are the second person to report this issue. Both of you are using a custom mail server. I am not sure what's the issue because I don't have an account to have a look.

Currently this app only support the outlook.com (original hotmail) & office.com (office365). You can switch the endpoint from the settings.

could you confirm what's your endpoint for your custom mail server? maybe the url are different.

Because you can actually running in dev mode. could you have a look if any error occurred in your running terminal console during the signin? also press F12 in the main app window will bring the devtools, check if any errors in the console as well (maybe also check the network tabs, any failed service call).

eNkru commented

if it's possible (which I don't believe lol) could you share your account, I'll have a look what's going on there.

lhjt commented

The mail server that my organisation is using is neither of the ones stated above; it is run on-premise at the organisation. If the app only works via those two endpoints, it is understandable that it would not work.

Unfortunately I can't share my account due to limitations, but I can confirm that when logging into the site from Chrome, a JavaScript popup is triggered asking for account details before continuing, and the current case may be that the app is preventing the popup from triggering and this preventing the user from signing in.

If you would like me to take a look at dev mode, how do I specifically run it in dev mode? Or his running it from yarn run automatically launch it in dev mode?

eNkru commented

yup. yarn run is running the app in dev mode.

I still don't understand how that works in your organisation's email. what's the URL for your login page?

If neither of them in the list and you didn't modify the app code, how you actually login your credentials with those predefined login pages? The login page you've seen in the app won't able to accept your credentials.

If my assumption is correct, you can still try modify one line of the code and see if that works :)

Just let me know the answer, cheers.

lhjt commented

The organisation has a custom mail server to which we connect to. When accessed online, it uses the outlook web app but can be accessed with any mail client. It's an exchange account. I will take a look to see again if I can log in.

The URL for the login page can be directly accessed from office.com and logged in from there.

eNkru commented

Could you share your URL of the mail window after login?

For example, after I login to my office.com it's redirect to my mail inbox, the URl is https://outlook.office.com/mail/inbox

Let me know what's yours

lhjt commented

Is there a way I can share it with you directly? My organisation would rather not have it displayed publicly on this thread.

eNkru commented

Is there a way I can share it with you directly? My organisation would rather not have it displayed publicly on this thread.

you can find my email or just left me a message from here -> https://enkru.github.io/

the last page

I've also noticed this.
After entering my email address, I'm redirected to my company's AD. This shows a popup message where I have to fill in my credentials (like a basic auth dialog). This will then redirect back to microsoft.

I've found this recent commit on a fork that might fix this? Not sure. https://github.com/farooqu/freelook/commit/d6d13f3eed5ce0711922cda2836aa001cdb144e2

eNkru commented

@michaelarnauts I've reviewed the fork and looks like it's a valid solution for browser basic auth. However I don't like what he created a form to capture username/password, then pass to the browser login event. I feel something not right to create a form to capture the password and passing around. (If you are using your own developed app, probably you won't mind).

I need think a better way to pass the password. The hard part is I don't have an account to test :(. Just wondering if any other developer has the account can do a PR for this.

I've applied the fix to this codebase, and it works fine, but it's annoying that it doesn't remember my credentials. I need to enter them every time...

@eNkru send me an email (check GitHub profile) and I can provide you with an email that asks for this kind of auth.

However I don't like what he created a form to capture username/password, then pass to the browser login event. I feel something not right to create a form to capture the password and passing around. (If you are using your own developed app, probably you won't mind).

It looks like what everyone else is doing. It ain't pretty, but it's kind of what can be done with the API that Electron provides.

I ended up doing the following, which is good enough just for my personal use.

main.js in initApp

const homedir = require('os').homedir();
const fs = require('fs')

app.on('login', function(event, webContents, request, authInfo, callback) {
      event.preventDefault();
      const credentials = fs.readFileSync(homedir + "/freelook.json");
      const parsedCredentials = JSON.parse(credentials);
      callback(parsedCredentials.username, parsedCredentials.password);
    })
eNkru commented

Above is a valid workaround for those third party auth. You could do the same to fix your authorisation issue. I still feel passing the password with clear text in the code logic is quite dangerous for a public repository and can be lead to wrong direction.

Free free do on your own computer because you have full control and protection.

Will close this now, and re-open this if you need some help. But I won't add this feature in the published app.