Refactor assetManager, renamed assetManager to assetStorage, renamed AssetT to AssetDataT, added better error handling in authentication service, continued working on dynamic asset loading for both maps and map editor
This commit is contained in:
@ -9,6 +9,9 @@ export async function register(username: string, email: string, password: string
|
||||
useCookies().set('token', response.data.token as string)
|
||||
return { success: true, token: response.data.token }
|
||||
} catch (error: any) {
|
||||
if (typeof error.response.data === 'undefined') {
|
||||
return { error: 'Could not connect to server' }
|
||||
}
|
||||
return { error: error.response.data.message }
|
||||
}
|
||||
}
|
||||
@ -30,6 +33,9 @@ export async function resetPassword(email: string) {
|
||||
const response = await axios.post(`${config.server_endpoint}/reset-password`, { email })
|
||||
return { success: true, token: response.data.token }
|
||||
} catch (error: any) {
|
||||
if (typeof error.response.data === 'undefined') {
|
||||
return { error: 'Could not connect to server' }
|
||||
}
|
||||
return { error: error.response.data.message }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user