Skip to content

Commit eb79719

Browse files
committed
fix(login): strip code once auth successfull
1 parent dbbfe91 commit eb79719

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/stores/router.store.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { ref } from 'vue';
33

44
const parseQuery = (location: Location) => {
55
const params = new URLSearchParams(location.href.split('?').at(1)?.replace(/#.*$/, ''));
6+
if (params.has('code')) {
7+
const url = new URL(location.href);
8+
url.searchParams.delete('code');
9+
window.history.replaceState({}, document.title, url);
10+
}
611
return Object.fromEntries(params.entries());
712
};
813

0 commit comments

Comments
 (0)