@@ -16,6 +16,7 @@ use diesel_async::pooled_connection::deadpool::Pool as DeadpoolPool;
16
16
use diesel_async:: pooled_connection:: AsyncDieselConnectionManager ;
17
17
use diesel_async:: AsyncPgConnection ;
18
18
use oauth2:: basic:: BasicClient ;
19
+ use oauth2:: { EndpointNotSet , EndpointSet } ;
19
20
20
21
type DeadpoolResult = Result <
21
22
diesel_async:: pooled_connection:: deadpool:: Object < AsyncPgConnection > ,
@@ -35,7 +36,8 @@ pub struct App {
35
36
pub github : Box < dyn GitHubClient > ,
36
37
37
38
/// The GitHub OAuth2 configuration
38
- pub github_oauth : BasicClient ,
39
+ pub github_oauth :
40
+ BasicClient < EndpointSet , EndpointNotSet , EndpointNotSet , EndpointNotSet , EndpointSet > ,
39
41
40
42
/// The server configuration
41
43
pub config : Arc < config:: Server > ,
@@ -70,14 +72,15 @@ impl App {
70
72
let instance_metrics =
71
73
InstanceMetrics :: new ( ) . expect ( "could not initialize instance metrics" ) ;
72
74
73
- let github_oauth = BasicClient :: new (
74
- config. gh_client_id . clone ( ) ,
75
- Some ( config. gh_client_secret . clone ( ) ) ,
76
- AuthUrl :: new ( String :: from ( "https://github.com/login/oauth/authorize" ) ) . unwrap ( ) ,
77
- Some (
78
- TokenUrl :: new ( String :: from ( "https://github.com/login/oauth/access_token" ) ) . unwrap ( ) ,
79
- ) ,
80
- ) ;
75
+ let auth_url = "https://github.com/login/oauth/authorize" ;
76
+ let auth_url = AuthUrl :: new ( auth_url. into ( ) ) . unwrap ( ) ;
77
+ let token_url = "https://github.com/login/oauth/access_token" ;
78
+ let token_url = TokenUrl :: new ( token_url. into ( ) ) . unwrap ( ) ;
79
+
80
+ let github_oauth = BasicClient :: new ( config. gh_client_id . clone ( ) )
81
+ . set_client_secret ( config. gh_client_secret . clone ( ) )
82
+ . set_auth_uri ( auth_url)
83
+ . set_token_uri ( token_url) ;
81
84
82
85
let primary_database = {
83
86
use secrecy:: ExposeSecret ;
0 commit comments