1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-07-15 23:36:27 +02:00

Newly created access tokens are now lowercase only

This commit is contained in:
binwiederhier 2023-06-14 11:20:29 -04:00
parent ae3e8a0094
commit e96e35b40b
4 changed files with 27 additions and 3 deletions

View file

@ -508,7 +508,7 @@ func (a *Manager) AuthenticateToken(token string) (*User, error) {
// after a fixed duration unless ChangeToken is called. This function also prunes tokens for the
// given user, if there are too many of them.
func (a *Manager) CreateToken(userID, label string, expires time.Time, origin netip.Addr) (*Token, error) {
token := util.RandomStringPrefix(tokenPrefix, tokenLength)
token := util.RandomLowerStringPrefix(tokenPrefix, tokenLength) // Lowercase only to support "<topic>+<token>@<domain>" email addresses
tx, err := a.db.Begin()
if err != nil {
return nil, err