Skip to content

Commit f235227

Browse files
committed
Rename the login arguments to correspong ProcessWire api.
1 parent fa18f0b commit f235227

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Field/Auth/LoginField.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ public function getDescription()
2929

3030
public function build(FieldConfig $config)
3131
{
32-
$config->addArgument('username', new NonNullType(new StringType()));
33-
$config->addArgument('password', new NonNullType(new StringType()));
32+
$config->addArgument('name', new NonNullType(new StringType()));
33+
$config->addArgument('pass', new NonNullType(new StringType()));
3434
}
3535

3636
public function resolve($value, array $args, ResolveInfo $info)
3737
{
3838
$session = \ProcessWire\wire('session');
39-
$username = $args['username'];
40-
$password = $args['password'];
39+
$username = $args['name'];
40+
$password = $args['pass'];
4141
$user = $session->login($username, $password);
4242
$response = new WireData();
4343
if (is_null($user)) {

0 commit comments

Comments
 (0)