Login, JWT and auth overstructure
* Signup -> Login -> JWT-Doot flow now works for users * Administrators cannot currently sign up for obvious reasons * Segmented the main.go methods into a core controller package
This commit is contained in:
15
util/util.go
15
util/util.go
@@ -1,6 +1,10 @@
|
||||
package util
|
||||
|
||||
import "crypto/rand"
|
||||
import (
|
||||
"crypto/rand"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func GenerateHmac() []byte {
|
||||
b := make([]byte, 64)
|
||||
@@ -10,3 +14,12 @@ func GenerateHmac() []byte {
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
type PrincipalInfo struct {
|
||||
Uid uuid.UUID
|
||||
Role string
|
||||
}
|
||||
|
||||
type FailMsg struct {
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user