Remove admin role alias from Teams auth
This commit is contained in:
@@ -24,7 +24,6 @@ export const userTypeDefs = `#graphql
|
||||
phone: String
|
||||
avatarId: String
|
||||
isManager: Boolean
|
||||
isAdmin: Boolean @deprecated(reason: "Use isManager")
|
||||
activeTeamId: String
|
||||
activeTeam: UserTeam
|
||||
teams: [UserTeam]
|
||||
@@ -63,7 +62,7 @@ export const userTypeDefs = `#graphql
|
||||
code: String!
|
||||
}
|
||||
|
||||
input AdminTotpLoginInput {
|
||||
input ManagerTotpLoginInput {
|
||||
phone: String!
|
||||
code: String!
|
||||
}
|
||||
@@ -126,7 +125,7 @@ export const userTypeDefs = `#graphql
|
||||
type Mutation {
|
||||
requestLoginOtp(input: RequestLoginOtpInput!): AuthChallenge!
|
||||
verifyLoginOtp(input: VerifyLoginOtpInput!): AuthPayload!
|
||||
adminTotpLogin(input: AdminTotpLoginInput!): AuthPayload!
|
||||
managerTotpLogin(input: ManagerTotpLoginInput!): AuthPayload!
|
||||
logout: Boolean!
|
||||
createTeam(input: CreateTeamInput!): CreateTeamResult
|
||||
updateUser(userId: String!, input: UpdateUserInput!): UpdateUserResult
|
||||
@@ -193,7 +192,6 @@ async function mapProfileUser(profile: Awaited<ReturnType<typeof getOrCreateProf
|
||||
phone: profile.phone,
|
||||
avatarId: profile.avatarId,
|
||||
isManager,
|
||||
isAdmin: isManager,
|
||||
activeTeamId: profile.activeTeam?.uuid ?? null,
|
||||
activeTeam: profile.activeTeam ? { id: profile.activeTeam.uuid, name: profile.activeTeam.name, teamType: profile.activeTeam.teamType, logtoOrgId: profile.activeTeam.logtoOrgId, createdAt: profile.activeTeam.createdAt.toISOString() } : null,
|
||||
teams: memberships.map(m => ({ id: m.team.uuid, name: m.team.name, teamType: m.team.teamType, logtoOrgId: m.team.logtoOrgId, createdAt: m.team.createdAt.toISOString() })),
|
||||
@@ -304,7 +302,7 @@ export const userResolvers = {
|
||||
return verifyPhoneLogin(args.input.phone, args.input.code)
|
||||
},
|
||||
|
||||
adminTotpLogin: async (_: unknown, args: { input: { phone: string; code: string } }) => {
|
||||
managerTotpLogin: async (_: unknown, args: { input: { phone: string; code: string } }) => {
|
||||
return verifyPhoneLogin(args.input.phone, args.input.code)
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user