Shorten login function to login

This commit is contained in:
Joe Nelson
2015-11-10 21:00:50 -08:00
parent 9daaf6ba70
commit 22fb13b30a
+2 -2
View File
@@ -223,7 +223,7 @@ create type
basic_auth.jwt_claims AS (role text, username text); basic_auth.jwt_claims AS (role text, username text);
create or replace function create or replace function
create_auth_token(username text, pass text) returns basic_auth.jwt_claims login(username text, pass text) returns basic_auth.jwt_claims
language plpgsql language plpgsql
as $$ as $$
declare declare
@@ -234,7 +234,7 @@ begin
if _role is null then if _role is null then
raise invalid_password using message = 'invalid user or password'; raise invalid_password using message = 'invalid user or password';
end if; end if;
select _role as role, create_auth_token.username as username into result; select _role as role, login.username as username into result;
return result; return result;
end; end;
$$; $$;