utils

package
v0.0.0-...-1738e17 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRequired

func AuthRequired(c *fiber.Ctx) error

AuthRequired memeriksa autentikasi JWT

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash memverifikasi password terhadap hash yang tersimpan

func GenerateToken

func GenerateToken(userID uint, email string, role string) (string, error)

GenerateToken menghasilkan JWT token untuk pengguna

func HashPassword

func HashPassword(password string) (string, error)

HashPassword meng-hash password sebelum menyimpannya ke database

func ParseToken

func ParseToken(tokenStr string) (*jwt.Token, *jwt.MapClaims, error)

ParseToken mem-parse JWT token dan mengembalikan klaim

Types

This section is empty.

Jump to

Keyboard shortcuts

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