Skip to content

Commit

Permalink
Calling the OAuth2
Browse files Browse the repository at this point in the history
  • Loading branch information
jankstar committed Oct 13, 2023
1 parent 2a8d6e4 commit 3aab6fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/docs/tauri_oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async fn js2rs(
}
```

## 3.5 Call ``log_in()``and ``get_token`` for OAuth2
## 3.5 Calling the OAuth2
The solution used here is taken from [oauth2 crate](https://github.com/ramosbugs/oauth2-rs/blob/main/examples/google.rs) and slightly optimised.

The ``log_in()`` function first fetches the access token via OAuth2 and then the user data for authentication. Only if both actions were successful, ``true`` is returned.
Expand Down Expand Up @@ -230,6 +230,7 @@ Match the ``get_token()`` function:
```
The login via ``get_toek()`` can use the email address or suggest it in the mask. If there is a refresh token, this can be used first. For this case a login is not necessary. These values are passed.

The ``get_token()`` function:
```rust
...
//get the google client ID and the client secret from .env file
Expand Down

0 comments on commit 3aab6fa

Please sign in to comment.