Skip to content

Commit e94588a

Browse files
committed
refactor: update account activation to use PUT method with token in request body
1 parent 20f9110 commit e94588a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/contexts/AuthContext.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => {
208208
const activateAccount = async (token: string): Promise<boolean> => {
209209
try {
210210
setLoading(true);
211-
const response = await fetch(`${API_BASE_URL}/users/activate?token=${token}`, {
212-
method: 'GET',
211+
const response = await fetch(`${API_BASE_URL}/users/activate`, {
212+
method: 'PUT',
213213
headers: { 'Content-Type': 'application/json' },
214+
body: JSON.stringify({ token })
214215
});
215216

216217
if (!response.ok) {

0 commit comments

Comments
 (0)