mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
change user data without sessionId
This commit is contained in:
parent
6ae5f6e23d
commit
5ff9842c0b
@ -38,9 +38,6 @@ export class ChangePasswordArgs {
|
||||
|
||||
@ArgsType()
|
||||
export class UpdateUserInfosArgs {
|
||||
@Field(() => Number)
|
||||
sessionId!: number
|
||||
|
||||
@Field(() => String)
|
||||
email!: string
|
||||
|
||||
|
||||
@ -108,11 +108,11 @@ export class UserResolver {
|
||||
return 'sucess'
|
||||
}
|
||||
|
||||
@Authorized()
|
||||
@Query(() => UpdateUserInfosResponse)
|
||||
async updateUserInfos(
|
||||
@Args()
|
||||
{
|
||||
sessionId,
|
||||
email,
|
||||
firstName,
|
||||
lastName,
|
||||
@ -122,9 +122,10 @@ export class UserResolver {
|
||||
password,
|
||||
passwordNew,
|
||||
}: UpdateUserInfosArgs,
|
||||
@Ctx() context: any,
|
||||
): Promise<UpdateUserInfosResponse> {
|
||||
const payload = {
|
||||
session_id: sessionId,
|
||||
session_id: context.sessionId,
|
||||
email,
|
||||
update: {
|
||||
'User.first_name': firstName || undefined,
|
||||
|
||||
@ -32,13 +32,13 @@ export default {
|
||||
localeChanged(locale)
|
||||
},
|
||||
async saveLocale(locale) {
|
||||
if (this.$i18n.locale === locale) return
|
||||
this.setLocale(locale)
|
||||
if (this.$store.state.sessionId && this.$store.state.email) {
|
||||
if (this.$store.state.email) {
|
||||
this.$apollo
|
||||
.query({
|
||||
query: updateUserInfos,
|
||||
variables: {
|
||||
sessionId: this.$store.state.sessionId,
|
||||
email: this.$store.state.email,
|
||||
locale: locale,
|
||||
},
|
||||
|
||||
@ -29,7 +29,6 @@ export const loginViaEmailVerificationCode = gql`
|
||||
|
||||
export const updateUserInfos = gql`
|
||||
query(
|
||||
$sessionId: Float!
|
||||
$email: String!
|
||||
$firstName: String
|
||||
$lastName: String
|
||||
@ -40,7 +39,6 @@ export const updateUserInfos = gql`
|
||||
$locale: String
|
||||
) {
|
||||
updateUserInfos(
|
||||
sessionId: $sessionId
|
||||
email: $email
|
||||
firstName: $firstName
|
||||
lastName: $lastName
|
||||
|
||||
@ -85,7 +85,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
showUserData: true,
|
||||
sessionId: this.$store.state.sessionId,
|
||||
form: {
|
||||
firstName: this.$store.state.firstName,
|
||||
lastName: this.$store.state.lastName,
|
||||
@ -118,7 +117,6 @@ export default {
|
||||
.query({
|
||||
query: updateUserInfos,
|
||||
variables: {
|
||||
sessionId: this.$store.state.sessionId,
|
||||
email: this.$store.state.email,
|
||||
firstName: this.form.firstName,
|
||||
lastName: this.form.lastName,
|
||||
|
||||
@ -48,7 +48,6 @@ export default {
|
||||
.query({
|
||||
query: updateUserInfos,
|
||||
variables: {
|
||||
sessionId: this.$store.state.sessionId,
|
||||
email: this.$store.state.email,
|
||||
newEmail: this.newEmail,
|
||||
},
|
||||
|
||||
@ -81,7 +81,6 @@ export default {
|
||||
.query({
|
||||
query: updateUserInfos,
|
||||
variables: {
|
||||
sessionId: this.$store.state.sessionId,
|
||||
email: this.$store.state.email,
|
||||
password: this.form.password,
|
||||
passwordNew: this.form.newPassword.password,
|
||||
|
||||
@ -90,7 +90,6 @@ export default {
|
||||
.query({
|
||||
query: updateUserInfos,
|
||||
variables: {
|
||||
sessionId: this.$store.state.sessionId,
|
||||
email: this.$store.state.email,
|
||||
username: this.form.username,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user