[#3617] added expiry field to the OAuth2 user
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
@@ -66,6 +67,8 @@ func (p *Mailcow) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) {
|
||||
RefreshToken: token.RefreshToken,
|
||||
}
|
||||
|
||||
user.Expiry, _ = types.ParseDateTime(token.Expiry)
|
||||
|
||||
// mailcow usernames are usually just the email adresses, so we just take the part in front of the @
|
||||
if strings.Contains(user.Username, "@") {
|
||||
user.Username = strings.Split(user.Username, "@")[0]
|
||||
|
||||
Reference in New Issue
Block a user