/
code.go
36 lines (28 loc) · 1.13 KB
/
code.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package otp
import (
"time"
"github.com/authgear/authgear-server/pkg/util/duration"
"github.com/iawaknahc/jsonschema/pkg/jsonpointer"
)
const (
WhatsappCodeDuration = duration.UserInteraction
)
type Code struct {
Target string `json:"target"`
Purpose Purpose `json:"purpose"`
Form Form `json:"form"`
Code string `json:"code"`
ExpireAt time.Time `json:"expire_at"`
Consumed bool `json:"consumed"`
UserInputtedCode string `json:"user_inputted_code,omitempty"`
UserID string `json:"user_id,omitempty"`
// For interaction
WebSessionID string `json:"web_session_id,omitempty"`
// For legacy workflow
WorkflowID string `json:"workflow_id,omitempty"`
// For authentication flow
AuthenticationFlowWebsocketChannelName string `json:"authentication_flow_websocket_channel_name,omitempty"`
AuthenticationFlowType string `json:"authentication_flow_type,omitempty"`
AuthenticationFlowName string `json:"authentication_flow_name,omitempty"`
AuthenticationFlowJSONPointer jsonpointer.T `json:"authentication_flow_json_pointer,omitempty"`
}