feat: change email, export my data, delete account (with data anonymization)
This commit is contained in:
1 parent
bb191c389a
commit
10a66cd979
123 files changed
+10789
-76
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package author
|
||||
|
||||
import "strconv"
|
||||
|
||||
const DeletedName = "Deleted user"
|
||||
|
||||
const DeletedSlugPrefix = "deleted-user-"
|
||||
|
||||
func DeletedSlug(id uint32) string {
|
||||
return DeletedSlugPrefix + strconv.FormatUint(uint64(id), 10)
|
||||
}
|
||||
|
||||
func DeletedSlugAttempt(id uint32, attempt int) string {
|
||||
if attempt <= 1 {
|
||||
return DeletedSlug(id)
|
||||
}
|
||||
return DeletedSlug(id) + "-" + strconv.Itoa(attempt)
|
||||
}
|
||||
|
||||
func IsReservedSlug(candidate string) bool {
|
||||
return len(candidate) >= len(DeletedSlugPrefix) && candidate[:len(DeletedSlugPrefix)] == DeletedSlugPrefix
|
||||
}
|
||||
|
||||
func avoidReserved(candidate string) string {
|
||||
if IsReservedSlug(candidate) {
|
||||
return FallbackSlug + "-" + candidate
|
||||
}
|
||||
return candidate
|
||||
}
|
||||
Reference in new issue
Block a user