File size: 435 Bytes
83a59ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package entities

import "github.com/google/uuid"

// AuthContext is the user gotten from an auth request
type AuthContext struct {
	ID            UserID     `json:"id"`
	PhoneAPIKeyID *uuid.UUID `json:"phone_api_key_id"`
	PhoneNumbers  []string   `json:"phone_numbers"`
	Email         string     `json:"email"`
}

// IsNoop checks if a user is empty
func (user AuthContext) IsNoop() bool {
	return user.ID == "" || user.Email == ""
}