realworld icon indicating copy to clipboard operation
realworld copied to clipboard

Settings Page Error

Open benjaminviaud opened this issue 3 years ago • 0 comments

Hello,

When I clone the last version. I login, I go to the settings page, I try to save settings, It gives an error : 401 Unauthorized

save.js

export async function post({ body: user, locals }) {
       console.log(locals) // returns {}
	
       if (!locals.user) {
		return {
			status: 401
		};
	}

	const { token } = locals.user;
	const body = await api.put(
		'user',
		{
			user // TODO individual properties
		},
		token
	);

	return respond(body);
}

benjaminviaud avatar May 19 '21 04:05 benjaminviaud