handler

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(user user.User, expiresIn, svcTokenID string) (string, error)

CreateToken creates a token for a user

func GetUserID

func GetUserID(r *http.Request) string

GetUserID returns the logged in user details

func MiddlewareAuthenticationVerification

func MiddlewareAuthenticationVerification(next http.Handler) http.Handler

MiddlewareAuthenticationVerification verifies user auth details

Types

type McApiContext added in v2.1.1

type McApiContext struct {
	Tenant string `json:"tenant" yaml:"tenant"`
	UserID string `json:"userId" yaml:"userId"`
}

struct used in api request

func IsValidToken

func IsValidToken(r *http.Request) (error, *McApiContext)

steps to verify the authentication 1. Verify the token in header 2. Verify the token in cookie

Jump to

Keyboard shortcuts

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