Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deprecate lite, add device #215

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading