Add OTP login page and auth guard for client cabinet
This commit is contained in:
8
graphql/operations/auth/request-login-code.graphql
Normal file
8
graphql/operations/auth/request-login-code.graphql
Normal file
@@ -0,0 +1,8 @@
|
||||
mutation RequestLoginCode($input: RequestLoginCodeInput!) {
|
||||
requestLoginCode(input: $input) {
|
||||
challengeToken
|
||||
channel
|
||||
destination
|
||||
expiresAt
|
||||
}
|
||||
}
|
||||
12
graphql/operations/auth/verify-login-code.graphql
Normal file
12
graphql/operations/auth/verify-login-code.graphql
Normal file
@@ -0,0 +1,12 @@
|
||||
mutation VerifyLoginCode($input: VerifyLoginCodeInput!) {
|
||||
verifyLoginCode(input: $input) {
|
||||
accessToken
|
||||
expiresAt
|
||||
user {
|
||||
id
|
||||
email
|
||||
fullName
|
||||
role
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,12 @@ enum MessengerType {
|
||||
MAX
|
||||
}
|
||||
|
||||
enum LoginChannel {
|
||||
EMAIL
|
||||
TELEGRAM
|
||||
MAX
|
||||
}
|
||||
|
||||
enum RegistrationStatus {
|
||||
PENDING
|
||||
APPROVED
|
||||
@@ -59,6 +65,19 @@ type User {
|
||||
company: Company
|
||||
}
|
||||
|
||||
type AuthCodeRequestResult {
|
||||
challengeToken: String!
|
||||
channel: LoginChannel!
|
||||
destination: String!
|
||||
expiresAt: DateTime!
|
||||
}
|
||||
|
||||
type AuthSession {
|
||||
accessToken: String!
|
||||
expiresAt: DateTime!
|
||||
user: User!
|
||||
}
|
||||
|
||||
type Invitation {
|
||||
id: ID!
|
||||
token: String!
|
||||
@@ -92,6 +111,23 @@ type MessengerConnection {
|
||||
isActive: Boolean!
|
||||
}
|
||||
|
||||
type MessengerDispatchResult {
|
||||
type: MessengerType!
|
||||
channelId: String!
|
||||
success: Boolean!
|
||||
detail: String!
|
||||
sentAt: DateTime!
|
||||
}
|
||||
|
||||
type NotificationHistoryItem {
|
||||
id: ID!
|
||||
channel: MessengerType!
|
||||
title: String!
|
||||
message: String!
|
||||
createdAt: DateTime!
|
||||
orderId: ID
|
||||
}
|
||||
|
||||
type Warehouse {
|
||||
id: ID!
|
||||
code: String!
|
||||
@@ -186,6 +222,9 @@ type ReferralStats {
|
||||
type Query {
|
||||
healthcheck: String!
|
||||
me: User
|
||||
myMessengerConnections: [MessengerConnection!]!
|
||||
myNotificationHistory(channel: MessengerType!, limit: Int = 50): [NotificationHistoryItem!]!
|
||||
managerNotificationHistory(userId: ID!, channel: MessengerType!, limit: Int = 50): [NotificationHistoryItem!]!
|
||||
clientProducts: [Product!]!
|
||||
myOrders: [Order!]!
|
||||
myCurrentOrders: [Order!]!
|
||||
@@ -194,6 +233,16 @@ type Query {
|
||||
referralStats: ReferralStats!
|
||||
}
|
||||
|
||||
input RequestLoginCodeInput {
|
||||
channel: LoginChannel!
|
||||
destination: String!
|
||||
}
|
||||
|
||||
input VerifyLoginCodeInput {
|
||||
challengeToken: String!
|
||||
code: String!
|
||||
}
|
||||
|
||||
input RegisterSelfInput {
|
||||
companyName: String!
|
||||
inn: String
|
||||
@@ -272,11 +321,14 @@ input ReviewRewardWithdrawalInput {
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
requestLoginCode(input: RequestLoginCodeInput!): AuthCodeRequestResult!
|
||||
verifyLoginCode(input: VerifyLoginCodeInput!): AuthSession!
|
||||
registerSelf(input: RegisterSelfInput!): RegistrationRequest!
|
||||
reviewRegistrationRequest(input: ReviewRegistrationRequestInput!): RegistrationRequest!
|
||||
createInvitation(input: CreateInvitationInput!): Invitation!
|
||||
acceptInvitation(input: AcceptInvitationInput!): User!
|
||||
connectMessenger(input: ConnectMessengerInput!): MessengerConnection!
|
||||
sendTestMessengerMessage(type: MessengerType!, channelId: String, message: String): MessengerDispatchResult!
|
||||
|
||||
submitReadyOrder(input: SubmitReadyOrderInput!): Order!
|
||||
submitCalculationOrder(input: SubmitCalculationOrderInput!): Order!
|
||||
|
||||
Reference in New Issue
Block a user