summaryrefslogtreecommitdiffstats
path: root/modules/auth/auth.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r--modules/auth/auth.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go
index 0d703084da..4b0d4559c9 100644
--- a/modules/auth/auth.go
+++ b/modules/auth/auth.go
@@ -105,9 +105,16 @@ func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool)
// Check if enabled auto-registration.
if setting.Service.EnableReverseProxyAutoRegister {
+ email := gouuid.NewV4().String() + "@localhost"
+ if setting.Service.EnableReverseProxyEmail {
+ webAuthEmail := ctx.Req.Header.Get(setting.ReverseProxyAuthEmail)
+ if len(webAuthEmail) > 0 {
+ email = webAuthEmail
+ }
+ }
u := &models.User{
Name: webAuthUser,
- Email: gouuid.NewV4().String() + "@localhost",
+ Email: email,
Passwd: webAuthUser,
IsActive: true,
}