Skip to content

Commit 591cc86

Browse files
committed
Fix user creation
1 parent be9177a commit 591cc86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/Http/Controllers/Admin/AccountsController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ public function postNew(Request $request)
8686
{
8787
try {
8888
$user = new UserRepository;
89-
$userid = $user->create($request->input('username'), $request->input('email'), $request->input('password'));
89+
$userid = $user->create($request->input('email'), $request->input('password'));
9090
Alert::success('Account has been successfully created.')->flash();
9191
return redirect()->route('admin.accounts.view', ['id' => $userid]);
9292
} catch (\Pterodactyl\Exceptions\DisplayValidationException $ex) {
93-
return redirect()->route('admin.nodes.view', $id)->withErrors(json_decode($e->getMessage()))->withInput();
93+
return redirect()->route('admin.accounts.new')->withErrors(json_decode($ex->getMessage()))->withInput();
9494
} catch (\Exception $ex) {
9595
Log::error($ex);
96-
Alert::danger('An error occured while attempting to add a new user. ' . $e->getMessage())->flash();
96+
Alert::danger('An error occured while attempting to add a new user. ' . $ex->getMessage())->flash();
9797
return redirect()->route('admin.accounts.new');
9898
}
9999
}

0 commit comments

Comments
 (0)