@@ -40,7 +40,7 @@ const COS_SECRET_ACCESS_KEY = process.env.cos_secret_access_key;
4040const APPID_OAUTH_SERVER_URL = process . env . appid_oauth_server_url ;
4141const APPID_CLIENT_ID = process . env . appid_client_id ;
4242const APPID_SECRET = process . env . appid_secret ;
43- const APPID_APP_URL = process . env . appid_app_url ;
43+ const APPID_REDIRECT_URIS = process . env . appid_redirect_uris . split ( ',' ) ; ;
4444
4545// Express setup, including session and passport support
4646var app = express ( ) ;
@@ -60,10 +60,10 @@ async function configureOIDC(req, res, next) {
6060 const client = new issuer . Client ( { // Initialize issuer information
6161 client_id : APPID_CLIENT_ID ,
6262 client_secret : APPID_SECRET ,
63- redirect_uris : [ APPID_APP_URL + '/redirect_uri' , 'http://sfs.4loeser.net/redirect_uri' , 'http://0.0.0.0:8081/redirect_uri' ]
63+ redirect_uris : APPID_REDIRECT_URIS
6464 } ) ;
6565 const params = {
66- redirect_uri : APPID_APP_URL + '/redirect_uri' ,
66+ redirect_uri : APPID_REDIRECT_URIS [ 0 ] ,
6767 scope :'openid' ,
6868 grant_type :'authorization_code' ,
6969 response_type :'code' ,
@@ -351,5 +351,6 @@ app.get('/api/user', function (req, res) {
351351
352352// start the server
353353const server = app . listen ( process . env . PORT || 8081 , ( ) => {
354+ console . log ( APPID_REDIRECT_URIS [ 0 ] ) ;
354355 console . log ( `Listening on port http://localhost:${ server . address ( ) . port } ` ) ;
355356} ) ;
0 commit comments