login

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LOCAL_KEYS = ".bootdevbuddy.json"
View Source
const OTP_LOGIN = "https://api.boot.dev/v1/auth/otp/login"
View Source
const REFRESH_URL = "https://api.boot.dev/v1/auth/refresh"

Variables

This section is empty.

Functions

func LogoutUser

func LogoutUser() error

func SaveTokens

func SaveTokens(tokens *BDToken) error

Types

type BDToken

type BDToken struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

func ExchangeOTPForToken

func ExchangeOTPForToken(OTP string) (*BDToken, error)

func ReadTokens

func ReadTokens() (*BDToken, error)

func RefreshToken

func RefreshToken() (*BDToken, error)

RefreshToken gets the refresh_token from the local file and uses it to refresh the user's access_token.

Jump to

Keyboard shortcuts

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