Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controller/network_user_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ func TestGetNetworkUser(t *testing.T) {
assert.Equal(t, networkUser.UserId, userId)
assert.Equal(t, networkUser.UserAuth, fmt.Sprintf("%s@bringyour.com", networkId))
assert.Equal(t, networkUser.Verified, true)
assert.Equal(t, networkUser.AuthType, model.AuthTypePassword)

})
}
7 changes: 7 additions & 0 deletions db_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -2137,4 +2137,11 @@ var migrations = []any{
ALTER TABLE account_payment
ADD COLUMN reliability_subsidy_nano_cents bigint NOT NULL DEFAULT 0
`),

newSqlMigration(`
ALTER TABLE network_user
DROP COLUMN auth_type,
DROP COLUMN wallet_address,
DROP COLUMN wallet_blockchain
`),
}
7 changes: 1 addition & 6 deletions model/device_association_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,10 @@ func DeviceConfirmAdopt(
device_adopt.device_spec,
network.network_id,
network.network_name,
network_user.auth_type as admin_auth_type,
device_adopt.owner_user_id
FROM device_adopt
INNER JOIN network ON
network.network_id = device_adopt.owner_network_id
LEFT JOIN network_user ON
network_user.user_id = network.admin_user_id
WHERE
device_adopt.device_association_id = $1
`,
Expand All @@ -810,7 +807,6 @@ func DeviceConfirmAdopt(
var networkId server.Id
var networkName string
var userId server.Id
var authType AuthType

server.WithPgResult(result, err, func() {
result.Next()
Expand All @@ -819,7 +815,6 @@ func DeviceConfirmAdopt(
&deviceSpec,
&networkId,
&networkName,
&authType,
&userId,
))
})
Expand Down Expand Up @@ -904,7 +899,7 @@ func DeviceConfirmAdopt(
adoptTime,
))

isGuestMode := (authType == AuthTypeGuest)
isGuestMode := isGuestMode(clientSession.Ctx, &userId)

byJwtWithClientId := jwt.NewByJwt(
networkId,
Expand Down
Loading