feat: add password changing
This commit is contained in:
1 parent
505175277c
commit
76f22dab5c
12 files changed
+138
-54
No files matched your search
+14
-1
@@ -135,7 +135,7 @@ export async function setUser(jwt: string, inst: string, username: string) {
|
||||
|
||||
return {
|
||||
profile: id,
|
||||
profiles: [...pd.profiles, newProfile],
|
||||
profiles: [newProfile, ...pd.profiles],
|
||||
}
|
||||
})
|
||||
|
||||
@@ -227,6 +227,19 @@ instance.subscribe(async (i) => {
|
||||
} catch (e) {}
|
||||
})
|
||||
|
||||
export function updateJwt(id: number, newJwt: string) {
|
||||
const pd = get(profileData)
|
||||
let prof = pd.profiles.find((p) => p.id == id)
|
||||
|
||||
if (!prof) return
|
||||
prof = serializeUser(prof)
|
||||
prof.jwt = newJwt
|
||||
|
||||
profileData.update((p) => ({ ...p, profile: id }))
|
||||
|
||||
profile.update(() => prof)
|
||||
}
|
||||
|
||||
export async function setUserID(id: number) {
|
||||
const pd = get(profileData)
|
||||
if (id == -1) {
|
||||
|
||||
Reference in new issue
Block a user