electronim icon indicating copy to clipboard operation
electronim copied to clipboard

Gitlab OAuth specific URLs

Open hkdb opened this issue 2 years ago • 4 comments

@manusa and contributors,

Really love this project! I have been cursed by Ferdium sucking up my batteries from the high CPU idle and after trying pretty much all the working alternatives out there, electronim is really a clear winner. Thanks for the great work! :)

One thing I did notice though is that web apps that involve Gitlab OAuth is opening the callback on the external browser which makes it not possible to login to those particular web apps.

In my particular case, we have a a self-hosted Gitlab instance with Mattermost which users login to Mattermost with Gitlab OAuth.

While a better long-term fix is potentially/questionably having a "load in electronim" option in the context menu or even having an address bar that can be toggled like Tangram so that OAuth logins can be URL agnostic, I was able to follow some of the previous issues and made the required changes in src/tab-manager/redirect.js as shown in the below commit to make things work.

https://github.com/hkdb/electronim/commit/342cf5eefe95c75454380047324b8955c2010c4d

Would be more than happy to do a pull request if that's desired.

Thanks again for the awesome work!

hkdb avatar Dec 29 '22 09:12 hkdb

Hey hkdb, I'm off until next week. Thx, sounds good, but let me get back to you when I'm back and I can review better.

manusa avatar Dec 29 '22 21:12 manusa

or even having an address bar that can be toggled like Tangram so that OAuth logins can be URL agnostic

Could you please elaborate on this?

I'm exploring the option to implement a configuration option so that users can add URLs that should be handled internally (https://github.com/manusa/electronim/issues/42#issuecomment-759357375) similar to what you suggest "having a "load in electronim"". However, I'm having a hard time trying to figure out the way to do this while keeping a simple user experience and reduced user interface for settings.

Regarding your PR, it's great if you can provide a generic (GitLab-related) fix for this. While checking your test, I don't understand how the regex you provide relates to the redirection URIs.

manusa avatar Jan 07 '23 07:01 manusa

Hi @manusa,

Sorry, I was a little lack of sleep when I made my original comment. Actually, Tangram does it a little differently. It gives you a temp browser with address bar so you can login and then when you are logged in and in the page that you like to start with, you can hit done and that effectly saves the state of the tab. Ferdium on the other hand has what I originally described where you can show or hide the address bar from the view menu:

Screenshot from 2023-01-07 02-38-13

Not sure if that's the best way to go about it though since you still may have to grab URLs and pasting it back in for the latter method which is sort of hacky.

With that said, having a configurable regexp list in settings is probably a better idea. Perhaps a set of templates of known web apps to select from and a collapsible input section as "Advanced/Custom" in settings?

As for the PR, again, affected by the lack of sleep. I had the wrong URLs in the test. Let me fix that and get back to you. I did however manually test and it does work. I have been since happily using our self-hosted Mattermost.

Thanks!

hkdb avatar Jan 07 '23 10:01 hkdb