Passed
Push — main ( f24a32...53c867 )
by Acho
03:11
created

entities.AuthContext.IsNoop   A

Complexity

Conditions 2

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
nop 0
1
package entities
2
3
import "github.com/google/uuid"
4
5
// AuthContext is the user gotten from an auth request
6
type AuthContext struct {
7
	ID            UserID     `json:"id"`
8
	PhoneAPIKeyID *uuid.UUID `json:"phone_api_key_id"`
9
	PhoneNumbers  []string   `json:"phone_numbers"`
10
	Email         string     `json:"email"`
11
}
12
13
// IsNoop checks if a user is empty
14
func (user AuthContext) IsNoop() bool {
15
	return user.ID == "" || user.Email == ""
16
}
17