Skip to content

Commit

Permalink
feat: deprecate lite, add device (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf authored Dec 11, 2023
1 parent b133ce9 commit 93b85f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/with-next/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Home = ({ app_id }: InferGetServerSidePropsType<typeof getServerSideProps>
onError={error => console.log(error)}
onSuccess={response => console.log(response)}
app_id={app_id}
verification_level={VerificationLevel.Lite}
verification_level={VerificationLevel.Device}
>
{({ open }) => <button onClick={open}>Open IDKit</button>}
</IDKitWidget>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const buffer_decode = (encoded: string): ArrayBuffer => {
*/
export const verification_level_to_credential_types = (verification_level: VerificationLevel): string[] => {
switch (verification_level) {
case VerificationLevel.Lite:
case VerificationLevel.Device:
return [CredentialType.Orb, CredentialType.Device]
case VerificationLevel.Orb:
return [CredentialType.Orb]
Expand All @@ -37,7 +37,7 @@ export const credential_type_to_verification_level = (credential_type: Credentia
case CredentialType.Orb:
return VerificationLevel.Orb
case CredentialType.Device:
return VerificationLevel.Lite
return VerificationLevel.Device
default:
throw new Error(`Unknown credential_type: ${credential_type}`)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export enum CredentialType {
}

export enum VerificationLevel {
Lite = 'lite',
Orb = 'orb',
Device = 'device',
}

export type IDKitConfig = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { __ } from '@/lang'
import { IDKITStage } from '@/types'
import useMedia from '@/hooks/useMedia'
import QRState from './WorldID/QRState'
import useIDKitStore from '@/store/idkit'
import { shallow } from 'zustand/shallow'
import { useEffect, useState } from 'react'
import type { IDKitStore } from '@/store/idkit'
import AboutWorldID from '@/components/AboutWorldID'
import { useWorldBridge } from '@/services/wld-bridge'
import LoadingIcon from '@/components/Icons/LoadingIcon'
import WorldcoinIcon from '@/components/Icons/WorldcoinIcon'
Expand All @@ -25,7 +23,6 @@ const getOptions = (store: IDKitStore) => ({
})

const WorldIDState = () => {
const media = useMedia()
const [showQR, setShowQR] = useState<boolean>(false)
const {
app_id,
Expand Down Expand Up @@ -57,7 +54,7 @@ const WorldIDState = () => {
}

if (result) {
if (verification_level == VerificationLevel.Orb && result.verification_level == VerificationLevel.Lite) {
if (verification_level == VerificationLevel.Orb && result.verification_level == VerificationLevel.Device) {
console.error(
'Credential type received from wallet does not match configured credential_types. This should only happen when manually selecting disallowed credentials in the Worldcoin Simulator.'
)
Expand Down

0 comments on commit 93b85f9

Please sign in to comment.