clerk

package
v0.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientSessionPathDev  = "%s/v1/client?_clerk_js_version=4.50.1&__dev_session=%s"
	ClientSessionPathProd = "%s/v1/client?_clerk_js_version=4.50.1"
)

Variables

View Source
var ErrMissingEmail = errors.New("couldn't find email address in claims")
View Source
var ErrNoSessions = errors.New("no sessions found in response")
View Source
var HTML = `<!doctype html>` + "\n" +
	`<html>
        <head>
                <meta charset="utf-8"/>
                <title>Login</title>
                <!--[if lt IE 9]>
                <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
                <![endif]-->
        </head>
        <body>
            <h3>Successfully logged in as {{email}}</h3>
            <div>Please close this tab or page and return to the CLI</div>
        </body>
</html>`

HTML is shown to the user after they log in.

Functions

func DecodeJWT

func DecodeJWT(jwt string) (string, string, error)

func FetchJwt

func FetchJwt(ctx context.Context) (string, error)

func GetClerkDomain

func GetClerkDomain() string

func GetClerkRootURL added in v0.1.10

func GetClerkRootURL() string

func GetJwtFile

func GetJwtFile() string

func GetJwtPath

func GetJwtPath() string

GetJwtPath returns the path to the jwt.json file where the JWT token is stored.

func GetSessionURL

func GetSessionURL(data *LoginData) string

func HasSession

func HasSession() (bool, error)

Types

type LoginData

type LoginData struct {
	UserID    string            `json:"userId"`
	SessionID string            `json:"sessionId"`
	Token     string            `json:"token"`
	Cookies   map[string]string `json:"cookies"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL