File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
examples/vanilla/src-tauri Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ rust-version = "1.57"
8
8
exclude = [" /examples" ]
9
9
10
10
[dependencies ]
11
- httparse = " 1.7 "
11
+ httparse = " 1"
12
12
log = " 0.4"
13
- tauri = { version = " 1.0" }
13
+ url = " 2"
14
+ tauri = { version = " 1" }
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ rust-version = "1.57"
10
10
[dependencies ]
11
11
serde_json = " 1.0"
12
12
serde = { version = " 1.0" , features = [ " derive" ] }
13
- tauri = { version = " 1.0.0-rc.8 " , features = [ " api-all" ] }
13
+ tauri = { version = " 1" , features = [ " api-all" ] }
14
14
tauri-plugin-oauth = { path = " ../../../" }
15
15
16
16
[build-dependencies ]
17
- tauri-build = { version = " 1.0.0-rc.7 " }
17
+ tauri-build = { version = " 1" }
18
18
19
19
[features ]
20
20
default = [ " custom-protocol" ]
Original file line number Diff line number Diff line change 3
3
windows_subsystem = "windows"
4
4
) ]
5
5
6
+ use tauri:: { command, Window } ;
7
+ use tauri_plugin_oauth:: start;
8
+
9
+ #[ command]
10
+ async fn start_server ( window : Window ) -> Result < u16 , String > {
11
+ start ( None , move |url| {
12
+ // Because of the unprotected localhost port, you must verify the URL here.
13
+ // Preferebly send back only the token, or nothing at all if you can handle everything else in Rust.
14
+ let _ = window. emit ( "redirect_uri" , url) ;
15
+ } ) . map_err ( |err| err. to_string ( ) )
16
+ }
17
+
6
18
fn main ( ) {
7
19
tauri:: Builder :: default ( )
8
- . plugin ( tauri_plugin_oauth :: init ( ) )
20
+ . invoke_handler ( tauri :: generate_handler! [ start_server ] )
9
21
. run ( tauri:: generate_context!( ) )
10
22
. expect ( "error while running tauri application" ) ;
11
23
}
You can’t perform that action at this time.
0 commit comments