Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dschoordsch committed Nov 28, 2023
1 parent e209bf5 commit f68fc56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const loginWithMicrosoft: MutationResolvers['loginWithMicrosoft'] = async (
if (existingUser) {
const {id: viewerId, identities, rol} = existingUser
let microsoftIdentity = identities.find(
(identity) => identity.type === AuthIdentityTypeEnum.MICROSOFT
) as AuthIdentityMicrosoft
(identity): identity is AuthIdentityMicrosoft => identity.type === AuthIdentityTypeEnum.MICROSOFT
)
if (!microsoftIdentity) {
const [bestIdentity] = identities
if (!bestIdentity) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extend type Mutation {
"""
Sign up or login using Google
Sign up or login using Microsoft
"""
loginWithMicrosoft(
"""
Expand Down
15 changes: 1 addition & 14 deletions packages/server/graphql/types/AuthIdentityMicrosoft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@ import {GraphQLID, GraphQLNonNull, GraphQLObjectType} from 'graphql'
import {GQLContext} from '../graphql'
import AuthIdentity, {authStrategyFields} from './AuthIdentity'

// google: {
// id: profile.id,
// email: profile.email,
// isVerified: profile.verified_email, // we'll assume this is always true
// name: profile.name,
// firstName: profile.given_name,
// lastName: profile.family_name,
// // link: profile.link, //who cares, it's google+
// picture: profile.picture,
// gender: profile.gender,
// locale: profile.locale
// }

const AuthIdentityMicrosoft = new GraphQLObjectType<any, GQLContext>({
name: 'AuthIdentityGoogle',
name: 'AuthIdentityMicrosoft',
interfaces: () => [AuthIdentity],
description: 'An authentication strategy using Microsoft',
fields: () => ({
Expand Down

0 comments on commit f68fc56

Please sign in to comment.