Skip to content

whatsauth/watoken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watoken

image

Whatsauth Token using PASETO, How to Use :

package controller

import (
 "fmt"
 "testing"

 "github.com/stretchr/testify/require"
 "github.com/whatsauth/watoken"
)

func TestWatoken(t *testing.T) {
   privateKey, publicKey := watoken.GenerateKey()
    
   //generate token for user awangga
   userid := "awangga"
   tokenstring, err := watoken.Encode(userid, privateKey)

    //decode token to get userid
   useridstring := watoken.DecodeGetId(publicKey, tokenstring)
   if useridstring == "" {
       fmt.Println("expire token")
   }

}

Tagging

git tag v0.1.8
git push origin --tags
go list -m github.com/whatsauth/watoken@v0.1.8

About

Whatsauth Token using PASETO

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages