feat: use create access token api endpoint instead of login mutation
This commit is contained in:
@@ -31,7 +31,6 @@ import verifyConnection from './mutations/verify-connection.js';
|
||||
|
||||
// Converted mutations
|
||||
import deleteUser from './mutations/delete-user.ee.js';
|
||||
import login from './mutations/login.js';
|
||||
|
||||
const mutationResolvers = {
|
||||
createAppAuthClient,
|
||||
@@ -50,7 +49,6 @@ const mutationResolvers = {
|
||||
duplicateFlow,
|
||||
executeFlow,
|
||||
generateAuthUrl,
|
||||
login,
|
||||
registerUser,
|
||||
resetConnection,
|
||||
updateAppAuthClient,
|
||||
|
@@ -1,17 +0,0 @@
|
||||
import User from '../../models/user.js';
|
||||
import createAuthTokenByUserId from '../../helpers/create-auth-token-by-user-id.js';
|
||||
|
||||
const login = async (_parent, params) => {
|
||||
const user = await User.query().findOne({
|
||||
email: params.input.email.toLowerCase(),
|
||||
});
|
||||
|
||||
if (user && (await user.login(params.input.password))) {
|
||||
const token = await createAuthTokenByUserId(user.id);
|
||||
return { token, user };
|
||||
}
|
||||
|
||||
throw new Error('User could not be found.');
|
||||
};
|
||||
|
||||
export default login;
|
@@ -18,7 +18,6 @@ type Mutation {
|
||||
duplicateFlow(input: DuplicateFlowInput): Flow
|
||||
executeFlow(input: ExecuteFlowInput): executeFlowType
|
||||
generateAuthUrl(input: GenerateAuthUrlInput): AuthLink
|
||||
login(input: LoginInput): Auth
|
||||
registerUser(input: RegisterUserInput): User
|
||||
resetConnection(input: ResetConnectionInput): Connection
|
||||
updateAppAuthClient(input: UpdateAppAuthClientInput): AppAuthClient
|
||||
@@ -152,11 +151,6 @@ enum ArgumentEnumType {
|
||||
string
|
||||
}
|
||||
|
||||
type Auth {
|
||||
user: User
|
||||
token: String
|
||||
}
|
||||
|
||||
type AuthenticationStep {
|
||||
type: String
|
||||
name: String
|
||||
@@ -403,11 +397,6 @@ input UpdateCurrentUserInput {
|
||||
fullName: String
|
||||
}
|
||||
|
||||
input LoginInput {
|
||||
email: String!
|
||||
password: String!
|
||||
}
|
||||
|
||||
input PermissionInput {
|
||||
action: String!
|
||||
subject: String!
|
||||
|
Reference in New Issue
Block a user