forked from forgejo/forgejo
parent
fe55ab2a68
commit
2a660a1de1
5 changed files with 28 additions and 10 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue