File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 20
20
21
21
# # restrict domain. (optional)
22
22
# domain:
23
- # - yourdomain.com
23
+ # - yourdomain.com # restrict by domain
24
+ # - [email protected] # or specific address
24
25
25
26
# document root for static files
26
27
htdocs : ./
Original file line number Diff line number Diff line change @@ -208,9 +208,15 @@ func restrictDomain(domain []string) martini.Handler {
208
208
var user * User
209
209
if len (domain ) > 0 {
210
210
for _ , d := range domain {
211
- if strings .HasSuffix (email , "@" + d ) {
212
- user = & User {email }
213
- break
211
+ if strings .Contains (d , "@" ) {
212
+ if d == email {
213
+ user = & User {email }
214
+ }
215
+ } else {
216
+ if strings .HasSuffix (email , "@" + d ) {
217
+ user = & User {email }
218
+ break
219
+ }
214
220
}
215
221
}
216
222
} else {
You can’t perform that action at this time.
0 commit comments