Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

fix: Perm 0 is admin #264

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion client/src/service/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
setUser(res.data);
setIsActivated(res.data.activated);
setIsLoggedIn(true);
setIsAdmin(res.data.permission === 1);
setIsAdmin(res.data.permission === 0);
return null;
})
.catch((err: AxiosError) => {
Expand Down
2 changes: 1 addition & 1 deletion server/src/v1/auth/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const register: IBareRouteHandler = async (req, res) => {
const createdUser = await db
.insert(usersTable)
.values({
permission: 0,
permission: 1,
username: validated.data.username,
email: validated.data.email,
password: await hashPassword(validated.data.password),
Expand Down