mirror of
https://github.com/dnote/dnote
synced 2026-03-16 23:45:52 +01:00
23 lines
554 B
Go
23 lines
554 B
Go
package session
|
|
|
|
import (
|
|
"github.com/dnote/dnote/pkg/server/models"
|
|
)
|
|
|
|
// Session represents user session
|
|
type Session struct {
|
|
UUID string `json:"uuid"`
|
|
Email string `json:"email"`
|
|
EmailVerified bool `json:"email_verified"`
|
|
Pro bool `json:"pro"`
|
|
}
|
|
|
|
// New returns a new session for the given user
|
|
func New(user models.User, account models.Account) Session {
|
|
return Session{
|
|
UUID: user.UUID,
|
|
Pro: user.Cloud,
|
|
Email: account.Email.String,
|
|
EmailVerified: account.EmailVerified,
|
|
}
|
|
}
|