Skip to content

Commit

Permalink
Simplify some code
Browse files Browse the repository at this point in the history
This is already handled by the account server.
  • Loading branch information
DaniElectra committed Oct 29, 2023
1 parent 12873ea commit 0087cc9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions globals/password_from_pid.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@ import (
func PasswordFromPID(pid uint32) (string, uint32) {
ctx := metadata.NewOutgoingContext(context.Background(), GRPCAccountCommonMetadata)

response, err := GRPCAccountClient.GetNEXData(ctx, &pb_account.GetNEXDataRequest{Pid: pid})
response, err := GRPCAccountClient.GetNEXPassword(ctx, &pb_account.GetNEXPasswordRequest{Pid: pid})
if err != nil {
globals.Logger.Error(err.Error())
return "", nex.Errors.RendezVous.InvalidUsername
}

// * We only allow tester accounts for now
if response.AccessLevel < 1 {
globals.Logger.Errorf("PID %d is not a tester!", response.Pid)
return "", nex.Errors.RendezVous.AccountDisabled
}

return response.Password, 0
}

0 comments on commit 0087cc9

Please sign in to comment.