File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,11 @@ func (p *SAMLCacheProvider) IsValid() bool {
61
61
return false
62
62
}
63
63
} else {
64
- cache_path = p .Filename
64
+ cache_path , err = homedir .Expand (p .Filename )
65
+ if err != nil {
66
+ logger .Debug ("Could not retrieve cache file location" , err )
67
+ return false
68
+ }
65
69
}
66
70
logger = logger .WithField ("Cache_file" , cache_path )
67
71
@@ -126,7 +130,10 @@ func (p *SAMLCacheProvider) ReadRaw() (string, error) {
126
130
return "" , errors .Wrap (err , "Could not retrieve cache file path" )
127
131
}
128
132
} else {
129
- cache_path = p .Filename
133
+ cache_path , err = homedir .Expand (p .Filename )
134
+ if err != nil {
135
+ return "" , errors .Wrap (err , "Could not retrieve cache file path" )
136
+ }
130
137
}
131
138
132
139
content , err := os .ReadFile (cache_path )
@@ -147,7 +154,10 @@ func (p *SAMLCacheProvider) WriteRaw(samlAssertion string) error {
147
154
return errors .Wrap (err , "Could not retrieve cache file path" )
148
155
}
149
156
} else {
150
- cache_path = p .Filename
157
+ cache_path , err = homedir .Expand (p .Filename )
158
+ if err != nil {
159
+ return errors .Wrap (err , "Could not retrieve cache file path" )
160
+ }
151
161
}
152
162
153
163
// create the directory if it doesn't exist
You can’t perform that action at this time.
0 commit comments