@@ -16,6 +16,7 @@ use diesel_async::pooled_connection::deadpool::Pool as DeadpoolPool;
1616use diesel_async:: pooled_connection:: AsyncDieselConnectionManager ;
1717use diesel_async:: AsyncPgConnection ;
1818use oauth2:: basic:: BasicClient ;
19+ use oauth2:: { EndpointNotSet , EndpointSet } ;
1920
2021type DeadpoolResult = Result <
2122 diesel_async:: pooled_connection:: deadpool:: Object < AsyncPgConnection > ,
@@ -35,7 +36,8 @@ pub struct App {
3536 pub github : Box < dyn GitHubClient > ,
3637
3738 /// The GitHub OAuth2 configuration
38- pub github_oauth : BasicClient ,
39+ pub github_oauth :
40+ BasicClient < EndpointSet , EndpointNotSet , EndpointNotSet , EndpointNotSet , EndpointSet > ,
3941
4042 /// The server configuration
4143 pub config : Arc < config:: Server > ,
@@ -70,14 +72,15 @@ impl App {
7072 let instance_metrics =
7173 InstanceMetrics :: new ( ) . expect ( "could not initialize instance metrics" ) ;
7274
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) ;
8184
8285 let primary_database = {
8386 use secrecy:: ExposeSecret ;
0 commit comments