Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG Interactive authentication not supported on Mac OS #485

Open
Yzoni opened this issue Jul 11, 2024 · 1 comment · May be fixed by #486
Open

BUG Interactive authentication not supported on Mac OS #485

Yzoni opened this issue Jul 11, 2024 · 1 comment · May be fixed by #486
Assignees
Labels
bug Something isn't working

Comments

@Yzoni
Copy link

Yzoni commented Jul 11, 2024

Describe the bug
Interactive authentication currently does not support mac os. It is unable to build on mac os due to tao::platform::unix not being available.

The target_family is set to unix which is included in target arch aarch64-apple-darwin.

#[cfg(target_family = "unix")]
use tao::platform::unix::EventLoopBuilderExtUnix;

Tao however only allows the following:
https://github.com/tauri-apps/tao/blob/0af78a924958f0b91f94fe58c78f26569cffdf5f/src/platform/unix.rs#L5-L11

To Reproduce
Steps to reproduce the behavior:

  1. Compile on mac os.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

error[E0432]: unresolved import `tao::platform::unix`
  --> /src/index.crates.io-6f17d22bba15001f/graph-oauth-2.0.0/src/interactive/interactive_auth.rs:14:20
   |
14 | use tao::platform::unix::EventLoopBuilderExtUnix;
   |                    ^^^^ could not find `unix` in `platform`

Desktop (please complete the following information):

  • OS: Mac OS M1
@Yzoni Yzoni added the bug Something isn't working label Jul 11, 2024
@sreeise sreeise linked a pull request Jul 12, 2024 that will close this issue
@sreeise
Copy link
Owner

sreeise commented Jul 12, 2024

Describe the bug Interactive authentication currently does not support mac os. It is unable to build on mac os due to tao::platform::unix not being available.

So this isn't necessarily a bug as much as it is an issue with macos not having the ability to run the webview on a separate thread. MacOs requires it being on the main thread and webview can cause the whole program to exit when the webview is closed.

I also don't have the ability to test on MacOS right now so theres that problem.

Regardless, the issue I mentioned above was before the interactive-auth was changed to use tao EventLoop run_return which should prevent the the program exiting. However, I can't guarentee that it will work because right now even with run_return we still run the webview on a separate thread and so this will probably just crash.

Even with that, I added a branch: https://github.com/sreeise/graph-rs-sdk/tree/interactive-auth-macos
with the MacOs specific platform settings. @Yzoni can you test this branch on MacOS? And then let me know whether you are successful in using interactive-auth or if there were errors (and what the errors are)? That way I will know whether another update will need to be made to change how the thread handling works for MacOs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants