Add keybase username and paper key validation#51
Conversation
| return fmt.Errorf("failed to validate KEYBASE_USERNAME and KEYBASE_PAPERKEY: %v", err) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
you can probably reorder this big block if you dont want these nested if statements...
i think remove the outer one and then returning nil earlier if they're both blank. whatever. not a blocker.
There was a problem hiding this comment.
Hmm, but returning nil seems like it would cause issues if someone else was adding more validation later on after this if (which seems likely). So I think best to keep with the pattern of one big if for each thing that is being validated.
There was a problem hiding this comment.
Hmm, but returning nil seems like it would cause issues if more validation was added to the end of this function (which seems likely). So I think probably best to keep with this large if block.
There was a problem hiding this comment.
it's all a frame of reference. i could just as easily see the validateUsernamePaperkey call be at the bottom as the last thing you might consider doing in a flow of possible validations. no thang.
Validate that:
In addition, validate that the user can log in if they are supplied.