auth

package
v0.0.0-...-ef817f9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken

func GetToken() (string, error)

GetToken returns the current token, refreshing it if necessary

func Logout

func Logout() error

Logout clears the authentication tokens

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	Role     string `json:"role"`
	jwt.RegisteredClaims
}

Claims represents the JWT claims

func GetUserInfo

func GetUserInfo() (*Claims, error)

GetUserInfo extracts user information from the JWT token

type TokenResponse

type TokenResponse struct {
	Token        string `json:"token"`
	RefreshToken string `json:"refreshToken"`
	ExpiresAt    int64  `json:"expiresAt"`
}

TokenResponse represents the response from the authentication endpoint

func Login

func Login(username, password string) (*TokenResponse, error)

Login authenticates with the Synkronus API and returns a token

func RefreshToken

func RefreshToken() (*TokenResponse, error)

RefreshToken refreshes the JWT token

Jump to

Keyboard shortcuts

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