mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-07 01:36:23 +08:00
register host with turn on creation
This commit is contained in:
@@ -96,6 +96,10 @@ func CreateHost(h *models.Host) error {
|
|||||||
if (err != nil && !database.IsEmptyRecord(err)) || (err == nil) {
|
if (err != nil && !database.IsEmptyRecord(err)) || (err == nil) {
|
||||||
return ErrHostExists
|
return ErrHostExists
|
||||||
}
|
}
|
||||||
|
err = RegisterHostWithTurn(h.ID.String(), h.HostPass)
|
||||||
|
if err != nil {
|
||||||
|
logger.Log(0, "failed to register host with turn server: ", err.Error())
|
||||||
|
}
|
||||||
// encrypt that password so we never see it
|
// encrypt that password so we never see it
|
||||||
hash, err := bcrypt.GenerateFromPassword([]byte(h.HostPass), 5)
|
hash, err := bcrypt.GenerateFromPassword([]byte(h.HostPass), 5)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user