mirror of
https://github.com/neilalexander/yggmail.git
synced 2026-05-03 02:26:28 +03:00
Back to hex keys after all
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package imapserver
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/emersion/go-imap"
|
||||
"github.com/emersion/go-imap/backend"
|
||||
"github.com/jxskiss/base62"
|
||||
"github.com/neilalexander/yggmail/internal/config"
|
||||
"github.com/neilalexander/yggmail/internal/storage"
|
||||
"github.com/neilalexander/yggmail/internal/utils"
|
||||
@@ -26,7 +26,7 @@ func (b *Backend) Login(_ *imap.ConnInfo, username, password string) (backend.Us
|
||||
return nil, fmt.Errorf("failed to authenticate: wrong domain in username")
|
||||
}
|
||||
}
|
||||
username = base62.EncodeToString(b.Config.PublicKey)
|
||||
username = hex.EncodeToString(b.Config.PublicKey)
|
||||
if authed, err := b.Storage.ConfigTryPassword(password); err != nil {
|
||||
b.Log.Printf("Failed to authenticate IMAP user %q due to error: %s", username, err)
|
||||
return nil, fmt.Errorf("failed to authenticate: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user