mirror of
https://github.com/writefreely/writefreely
synced 2024-11-14 21:27:07 +00:00
f404f7b928
This adds a self-serve password reset page. Users can enter their username and receive an email with a link that will let them create a new password. If they've never set a password, it will send them a one-time login link (building on #776) that will then take them to their Account Settings page. If they don't have an email associated with their account, they'll be instructed to contact the admin, so they can manually reset the password. Includes changes to the stylesheet and database, so run: make ui writefreely db migrate Closes T508
25 lines
506 B
Go
25 lines
506 B
Go
/*
|
|
* Copyright © 2023 Musing Studio LLC.
|
|
*
|
|
* This file is part of WriteFreely.
|
|
*
|
|
* WriteFreely is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License, included
|
|
* in the LICENSE file in this source code package.
|
|
*/
|
|
|
|
package spam
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
)
|
|
|
|
func GetIP(r *http.Request) string {
|
|
h := r.Header.Get("X-Forwarded-For")
|
|
if h == "" {
|
|
return ""
|
|
}
|
|
ips := strings.Split(h, ",")
|
|
return strings.TrimSpace(ips[0])
|
|
}
|