auth.go 376 B

123456789101112131415161718192021
  1. package auth
  2. import (
  3. "github.com/gravitl/netmaker/logic"
  4. "github.com/gravitl/netmaker/models"
  5. )
  6. // == consts ==
  7. const (
  8. node_signin_length = 64
  9. )
  10. func isUserIsAllowed(username, network string) (*models.User, error) {
  11. user, err := logic.GetUser(username)
  12. if err != nil { // user must not exist, so try to make one
  13. return &models.User{}, err
  14. }
  15. return user, nil
  16. }