Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Change OAuth user ids to hash ids #1557

Merged
merged 1 commit into from
Jul 27, 2022
Merged
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
6 changes: 4 additions & 2 deletions packages/web/src/pages/oauth-login-page/OAuthLoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import AudiusBackend from 'services/AudiusBackend'
import { make, useRecord } from 'store/analytics/actions'
import { getCreatorNodeIPFSGateways } from 'utils/gatewayUtil'
import { ERROR_PAGE, SIGN_UP_PAGE } from 'utils/route'
import { encodeHashId } from 'utils/route/hashIds'
import { signOut } from 'utils/signOut'

import styles from '../styles/OAuthLoginPage.module.css'
Expand Down Expand Up @@ -290,14 +291,15 @@ export const OAuthLoginPage = () => {
}
}
const timestamp = Math.round(new Date().getTime() / 1000)
const userId = encodeHashId(account?.user_id)
const response = {
userId: account?.user_id,
userId,
email,
name: account?.name,
handle: account?.handle,
verified: account?.is_verified,
profilePicture,
sub: account?.user_id,
sub: userId,
iat: timestamp
}
const header = base64url.encode(
Expand Down