@@ -41,10 +41,15 @@ func TestConfigParsing(t *testing.T) {
41
41
t .Setenv ("AZURE_SECRET" , "this is cool" )
42
42
t .Setenv ("AUTH_SEND_SMS_SECRETS" , "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==" )
43
43
t .Setenv ("SENDGRID_API_KEY" , "sendgrid" )
44
+ t .Setenv ("AUTH_CALLBACK_URL" , "http://localhost:3000/auth/callback" )
44
45
assert .NoError (t , config .Load ("" , fsys ))
45
46
// Check error
46
47
assert .Equal (t , "hello" , config .Auth .External ["azure" ].ClientId )
47
48
assert .Equal (t , "this is cool" , config .Auth .External ["azure" ].Secret )
49
+ assert .Equal (t , []string {
50
+ "https://127.0.0.1:3000" ,
51
+ "http://localhost:3000/auth/callback" ,
52
+ }, config .Auth .AdditionalRedirectUrls )
48
53
})
49
54
50
55
t .Run ("config file with environment variables fails when unset" , func (t * testing.T ) {
@@ -70,6 +75,7 @@ func TestConfigParsing(t *testing.T) {
70
75
t .Setenv ("AZURE_SECRET" , "this is cool" )
71
76
t .Setenv ("AUTH_SEND_SMS_SECRETS" , "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==" )
72
77
t .Setenv ("SENDGRID_API_KEY" , "sendgrid" )
78
+ t .Setenv ("AUTH_CALLBACK_URL" , "http://localhost:3000/auth/callback" )
73
79
assert .NoError (t , config .Load ("" , fsys ))
74
80
// Check the default value in the config
75
81
assert .Equal (t , "http://127.0.0.1:3000" , config .Auth .SiteUrl )
0 commit comments