~james/core

core/api/org_tangled/tempaccountcompleteSignup.go -rw-r--r-- 2.5 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package org_tangled

// schema: org.tangled.temp.account.completeSignup

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

const (
	TempAccountCompleteSignupNSID = "org.tangled.temp.account.completeSignup"
)

// TempAccountCompleteSignup_Authorization is a "authorization" in the org.tangled.temp.account.completeSignup schema.
//
// The OAuth authorization response for requestUri, as the PDS would have put it in the redirect.
type TempAccountCompleteSignup_Authorization struct {
	Code  string `json:"code" cborgen:"code"`
	Iss   string `json:"iss" cborgen:"iss"`
	State string `json:"state" cborgen:"state"`
}

// TempAccountCompleteSignup_Input is the input argument to a org.tangled.temp.account.completeSignup call.
type TempAccountCompleteSignup_Input struct {
	// password: Password for the new account.
	Password string `json:"password" cborgen:"password"`
	// requestUri: request_uri of the browser's pushed OAuth authorization request at the PDS. When the PDS supports it, the new account authorizes that request without the PDS sign-in and consent screens.
	RequestUri *string `json:"requestUri,omitempty" cborgen:"requestUri,omitempty"`
	// token: Verification token from the emailed link.
	Token string `json:"token" cborgen:"token"`
	// username: Desired username; the handle is <username>.<pds domain>.
	Username string `json:"username" cborgen:"username"`
}

// TempAccountCompleteSignup_Output is the output of a org.tangled.temp.account.completeSignup call.
type TempAccountCompleteSignup_Output struct {
	// authorization: Present when the PDS authorized requestUri for the new account. Without it the browser signs in through the PDS.
	Authorization *TempAccountCompleteSignup_Authorization `json:"authorization,omitempty" cborgen:"authorization,omitempty"`
	// did: DID of the newly provisioned account.
	Did string `json:"did" cborgen:"did"`
	// handle: The assigned handle, <username>.<pds domain>.
	Handle string `json:"handle" cborgen:"handle"`
}

// TempAccountCompleteSignup calls the XRPC method "org.tangled.temp.account.completeSignup".
func TempAccountCompleteSignup(ctx context.Context, c util.LexClient, input *TempAccountCompleteSignup_Input) (*TempAccountCompleteSignup_Output, error) {
	var out TempAccountCompleteSignup_Output
	if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.completeSignup", nil, input, &out); err != nil {
		return nil, err
	}

	return &out, nil
}