feat: use multi roles login (#60)

* feat: use multi roles login

- add support for protected roles
- refactor oauth code

* fix: adminUpdate role validation

* fix: update app
This commit is contained in:
Lakhan Samani
2021-10-13 22:11:41 +05:30
committed by GitHub
parent 27944cf7b5
commit b376ee3b73
23 changed files with 248 additions and 219 deletions

View File

@@ -61,13 +61,13 @@ input SignUpInput {
password: String!
confirmPassword: String!
image: String
roles: [String]
roles: [String!]
}
input LoginInput {
email: String!
password: String!
role: String
roles: [String!]
}
input VerifyEmailInput {
@@ -90,12 +90,12 @@ input UpdateProfileInput {
}
input AdminUpdateUserInput {
id: ID!
email: String
firstName: String
lastName: String
image: String
roles: [String]
id: ID!
email: String
firstName: String
lastName: String
image: String
roles: [String]
}
input ForgotPasswordInput {
@@ -117,7 +117,7 @@ type Mutation {
login(params: LoginInput!): AuthResponse!
logout: Response!
updateProfile(params: UpdateProfileInput!): Response!
adminUpdateUser(params: AdminUpdateUserInput!): User!
adminUpdateUser(params: AdminUpdateUserInput!): User!
verifyEmail(params: VerifyEmailInput!): AuthResponse!
resendVerifyEmail(params: ResendVerifyEmailInput!): Response!
forgotPassword(params: ForgotPasswordInput!): Response!
@@ -128,7 +128,7 @@ type Mutation {
type Query {
meta: Meta!
users: [User!]!
token(role: String): AuthResponse
token(roles: [String!]): AuthResponse
profile: User!
verificationRequests: [VerificationRequest!]!
}