WIP user creation

pull/1/head
vilmibm 2023-03-03 21:29:13 +00:00
parent 4847c19eaf
commit 3940fe58ae
1 changed files with 20 additions and 1 deletions

View File

@ -244,12 +244,31 @@ func _main() error {
s = s.SetString("cool, awesome, going to make your account now...") s = s.SetString("cool, awesome, going to make your account now...")
fmt.Println(s) fmt.Println(s)
// TODO have enough to make account; can now do that if err = createUser(*data); err != nil {
s = s.SetString(fmt.Sprintf(`augh, I'm sorry. the account creation failed.
Please email root@tilde.town and paste the following error:
%s
Your invite code has not been marked as used and you're welcome to try again, though if there is a system issue you might need to wait for word from an admin.`, err.Error()))
fmt.Println(s)
return nil
}
// TODO assuming account creation succeeded, mark invite as used // TODO assuming account creation succeeded, mark invite as used
return nil return nil
} }
func createUser(data newUserData) error {
// TODO adduser
// TODO add to town group
// TODO create keyfile by running helper (helper should also make ~/.ssh)
// TODO generate welcome gift
// TODO any alerts
return errors.New("not implemented")
}
func main() { func main() {
// TODO friendlier error handling // TODO friendlier error handling
err := _main() err := _main()