Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
141d079
chore: remove unused components, barrel files, dependencies
KirillKirill Jul 15, 2026
4429a95
feat: redesign auth flow
KirillKirill Jul 22, 2026
639d8db
fix: address copilot comments
KirillKirill Jul 22, 2026
b983d32
chore: minor refactoring and improvements
KirillKirill Jul 22, 2026
c39e0d0
chore: change path to the password input component
KirillKirill Jul 23, 2026
8ac48df
chore: remove BackgroundContext
KirillKirill Jul 23, 2026
593e78b
chore: minor ui improvements
KirillKirill Jul 27, 2026
9ff1fb6
chore: shorten css rule
KirillKirill Jul 27, 2026
ef88919
chore: add base modal and base drawer components for reusing them
KirillKirill Jul 31, 2026
62b5223
chore: add responsive overlay component
KirillKirill Jul 31, 2026
85f59eb
chore: address feedback
KirillKirill Aug 5, 2026
96367b7
[Human App Frontend] Redesign Profile (#3985)
KirillKirill Aug 5, 2026
fdebc05
fix: style issues with desktop aside bar and jobs discovery page
KirillKirill Aug 6, 2026
9158d13
chore: ui improvements of mode switcher, styles and service params
KirillKirill Aug 6, 2026
0175c50
fix: redirect to verifyEmail after sign in, if email isnt verified
KirillKirill Aug 6, 2026
e2c08ec
feat: rework the oracle registration page
KirillKirill Aug 6, 2026
e3db7de
chore: change color of buttons on the homepage
KirillKirill Aug 6, 2026
aeff0d2
fix: improve auth and verification logic
KirillKirill Aug 6, 2026
d03a87c
feat: add new page verifyUser, that goes after sign-in
KirillKirill Aug 6, 2026
e00bd61
fix: bug with redirects related to verifyUser
KirillKirill Aug 7, 2026
c01335c
fix: chat does not open on mobile
KirillKirill Aug 7, 2026
14ceb34
[Human App Frontend] Remove 'Operator' part and other unused pieces (…
KirillKirill Aug 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions packages/apps/human-app/frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ VITE_HMT_DAILY_SPENT_LIMIT=0
# hCaptcha annotation tool
VITE_H_CAPTCHA_EXCHANGE_URL=replace_me
VITE_H_CAPTCHA_LABELING_BASE_URL=replace_me
VITE_H_CAPTCHA_ORACLE_ADDRESS=replace_me
VITE_H_CAPTCHA_ORACLE_ANNOTATION_TOOL=hcaptcha
VITE_H_CAPTCHA_ORACLE_ROLE=hcaptcha
VITE_H_CAPTCHA_ORACLE_TASK_TYPES=image_points,image_boxes

# Other
VITE_HUMAN_PROTOCOL_HELP_URL=https://docs.humanprotocol.org/
Expand Down
9 changes: 0 additions & 9 deletions packages/apps/human-app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@mui/x-date-pickers": "^9.9.0",
"@reown/appkit": "^1.8.20",
"@reown/appkit-adapter-wagmi": "^1.8.20",
"@synaps-io/verify-sdk": "^4.0.45",
"@tanstack/react-query": "^5.91.3",
"@wagmi/core": "^3.4.0",
"date-fns": "^4.1.0",
Expand All @@ -40,13 +39,11 @@
"lodash": "^4.18.1",
"material-react-table": "3.0.1",
"notistack": "^3.0.1",
"prop-types": "^15.8.1",
"query-string": "^9.0.0",
"react": "^19.2.6",
"react-dom": "^19.2.6",
"react-hook-form": "^7.71.1",
"react-i18next": "^15.1.0",
"react-imask": "^7.4.0",
"react-number-format": "^5.4.5",
"react-router-dom": "^7.18.1",
"serve": "^14.2.6",
Expand All @@ -58,23 +55,17 @@
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@tanstack/eslint-plugin-query": "^5.60.1",
"@tanstack/react-query-devtools": "^5.59.16",
"@types/lodash": "^4.17.24",
"@types/node": "^22.10.5",
"@types/prop-types": "^15",
"@types/react": "^19.2.15",
"@types/react-dom": "^19.2.3",
"@vercel/style-guide": "^6.0.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^10.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.7.0",
"husky": "^9.1.6",
"jsdom": "^29.1.1",
"prettier": "^3.8.1",
"typescript": "^6.0.2",
Expand Down
26 changes: 8 additions & 18 deletions packages/apps/human-app/frontend/src/api/auth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ import {
} from '@/shared/schemas';
import { type BrowserAuthProvider } from '@/shared/types/browser-auth-provider';
import { type HttpApiClient } from './http-api-client';
import { commonApiPaths } from './common-api-paths';

export interface AuthProvider {
getAccessToken: () => Promise<string | null>;
refreshAccessToken: () => Promise<void>;
}

const apiPaths = {
worker: {
signIn: {
path: '/auth/signin',
},
},
} as const;
signIn: '/auth/signin',
refresh: '/auth/refresh',
};

export class AuthService implements AuthProvider {
private readonly browserAuthProvider: BrowserAuthProvider =
Expand All @@ -31,16 +27,16 @@ export class AuthService implements AuthProvider {

constructor(private readonly httpClient: HttpApiClient) {}

async signIn(data: SignInDto): Promise<void> {
async signIn(data: SignInDto): Promise<AuthTokensSuccessResponse> {
const res = await this.httpClient.post<AuthTokensSuccessResponse>(
apiPaths.worker.signIn.path,
apiPaths.signIn,
{
successSchema: authTokensSuccessResponseSchema,
body: data,
}
);

this.browserAuthProvider.signIn(res, 'web2');
return res;
}

async getAccessToken(): Promise<string | null> {
Expand Down Expand Up @@ -70,12 +66,6 @@ export class AuthService implements AuthProvider {
}

async refreshAccessToken(): Promise<void> {
const authType = this.browserAuthProvider.getAuthType();

if (!authType) {
throw new Error('Auth type not found');
}

if (!AuthService.refreshPromise) {
AuthService.refreshPromise = this.fetchTokenRefresh();
}
Expand All @@ -88,7 +78,7 @@ export class AuthService implements AuthProvider {
throw new Error('Failed to refresh access token');
}

browserAuthProvider.signIn(tokens, authType);
browserAuthProvider.signIn(tokens);
}

private async fetchTokenRefresh(): Promise<AuthTokensSuccessResponse | null> {
Expand All @@ -100,7 +90,7 @@ export class AuthService implements AuthProvider {

try {
const response = await this.httpClient.post<AuthTokensSuccessResponse>(
commonApiPaths.auth.refresh.path,
apiPaths.refresh,
{
body: {
refresh_token: refreshToken,
Expand Down
7 changes: 0 additions & 7 deletions packages/apps/human-app/frontend/src/api/common-api-paths.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,28 @@ import { useMutation } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
import { useAuth } from '@/modules/auth/hooks/use-auth';
import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider';
import type { AuthType } from '@/shared/types/browser-auth-provider';
import { useWeb3Auth } from '@/modules/auth-web3/hooks/use-web3-auth';
import { routerPaths } from '@/router/router-paths';
import { authService } from '../authorized-http-api-client';

type RefreshAccessTokenParams = {
throwExpirationModalOnSignOut?: boolean;
};

export function useAccessTokenRefresh() {
const navigate = useNavigate();
const { signOut: web2SignOut, user: web2User } = useAuth();

const { signOut: web3SignOut, user: web3User } = useWeb3Auth();
const { user, signOut } = useAuth();

const mutation = useMutation({
mutationFn: async ({
authType,
throwExpirationModalOnSignOut = true,
}: {
authType: AuthType;
throwExpirationModalOnSignOut?: boolean;
}) => {
mutationFn: async (params?: RefreshAccessTokenParams) => {
const throwExpirationModalOnSignOut =
params?.throwExpirationModalOnSignOut ?? true;

try {
await authService.refreshAccessToken();
} catch (error) {
console.error(error);
if (authType === 'web2' && web2User) {
web2SignOut({ throwExpirationModal: false });
}
if (authType === 'web3' && web3User) {
web3SignOut({ throwExpirationModal: false });
if (user) {
signOut({ throwExpirationModal: false });
}
browserAuthProvider.signOut({
triggerSignOutSubscriptions: throwExpirationModalOnSignOut,
Expand All @@ -45,7 +39,16 @@ export function useAccessTokenRefresh() {
});

return {
refreshAccessToken: mutation.mutate,
refreshAccessTokenAsync: mutation.mutateAsync,
refreshAccessToken: (
params?: RefreshAccessTokenParams,
options?: Parameters<typeof mutation.mutate>[1]
) => {
mutation.mutate(params, options);
},
refreshAccessTokenAsync: (
params?: RefreshAccessTokenParams,
options?: Parameters<typeof mutation.mutateAsync>[1]
) => mutation.mutateAsync(params, options),
isRefreshingAccessToken: mutation.isPending,
};
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading