Skip to content

Commit

Permalink
Merge pull request #7 from GravityTwoG/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
GravityTwoG authored Feb 29, 2024
2 parents 50ca012 + d09631f commit da70d81
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
permissions:
contents: read # for checkout

env:
VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }}

jobs:
release:
name: Release
Expand All @@ -29,8 +32,9 @@ jobs:
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Print env
run: echo "Hello $VITE_API_BASE_URL"
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }}
run: npx semantic-release
16 changes: 14 additions & 2 deletions src/client/api/AuthAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,27 @@ export class AuthAPI implements IAuthAPI {
};

changePassword = (credentials: ChangePasswordCredentials): Promise<void> => {
return fetcher.post("/auth/change-password", { body: credentials });
return fetcher.post("/auth/auth-change-password", {
body: {
oldPassword: credentials.oldPassword,
password: credentials.newPassword,
repeatedPassword: credentials.newPassword,
},
});
};

requestPasswordReset = (email: string): Promise<void> => {
return fetcher.post("/auth/recover-password", { body: { email } });
};

resetPassword = (credentials: ResetPasswordCredentials): Promise<void> => {
return fetcher.post("/auth/reset-password", { body: credentials });
return fetcher.post("/auth/change-password", {
body: {
token: credentials.token,
password: credentials.newPassword,
repeatedPassword: credentials.newPassword,
},
});
};

logout = async (): Promise<void> => {
Expand Down
3 changes: 2 additions & 1 deletion src/client/pages/Profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useAuthContext } from "@/client/contexts/AuthContext/useAuthContext";
import { notify } from "@/client/ui/toast";

import { Container } from "@/client/ui/atoms/Container/Container";
import { H1, H2 } from "@/client/ui/atoms/Typography";
Expand Down Expand Up @@ -32,7 +33,7 @@ export const ProfilePage = () => {
newPassword: data.newPassword,
});

alert("Password changed");
notify.success("Password changed");
} catch (error) {
if (error instanceof Error) {
return error.message;
Expand Down

0 comments on commit da70d81

Please sign in to comment.