Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
fff42ebc
Commit
fff42ebc
authored
Nov 30, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: check auth status
parent
2437419b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
486 additions
and
477 deletions
+486
-477
auth_service.go
api/v2/auth_service.go
+6
-4
auth_service.proto
proto/api/v2/auth_service.proto
+2
-1
README.md
proto/gen/api/v2/README.md
+428
-428
auth_service.pb.go
proto/gen/api/v2/auth_service.pb.go
+44
-38
user.ts
web/src/store/module/user.ts
+6
-6
No files found.
api/v2/auth_service.go
View file @
fff42ebc
...
@@ -3,16 +3,18 @@ package v2
...
@@ -3,16 +3,18 @@ package v2
import
(
import
(
"context"
"context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
apiv2pb
"github.com/usememos/memos/proto/gen/api/v2"
apiv2pb
"github.com/usememos/memos/proto/gen/api/v2"
)
)
func
(
s
*
APIV2Service
)
GetAuthStatus
(
ctx
context
.
Context
,
_
*
apiv2pb
.
GetAuthStatusRequest
)
(
*
apiv2pb
.
GetAuthStatusResponse
,
error
)
{
func
(
s
*
APIV2Service
)
GetAuthStatus
(
ctx
context
.
Context
,
_
*
apiv2pb
.
GetAuthStatusRequest
)
(
*
apiv2pb
.
GetAuthStatusResponse
,
error
)
{
ok
:=
true
user
,
err
:=
getCurrentUser
(
ctx
,
s
.
Store
)
user
,
err
:=
getCurrentUser
(
ctx
,
s
.
Store
)
if
err
!=
nil
||
user
==
nil
{
if
err
!=
nil
{
ok
=
false
return
nil
,
status
.
Errorf
(
codes
.
Unauthenticated
,
"failed to get current user: %v"
,
err
)
}
}
return
&
apiv2pb
.
GetAuthStatusResponse
{
return
&
apiv2pb
.
GetAuthStatusResponse
{
Ok
:
ok
,
User
:
convertUserFromStore
(
user
)
,
},
nil
},
nil
}
}
proto/api/v2/auth_service.proto
View file @
fff42ebc
...
@@ -2,6 +2,7 @@ syntax = "proto3";
...
@@ -2,6 +2,7 @@ syntax = "proto3";
package
memos
.
api.v2
;
package
memos
.
api.v2
;
import
"api/v2/user_service.proto"
;
import
"google/api/annotations.proto"
;
import
"google/api/annotations.proto"
;
option
go_package
=
"gen/api/v2"
;
option
go_package
=
"gen/api/v2"
;
...
@@ -15,5 +16,5 @@ service AuthService {
...
@@ -15,5 +16,5 @@ service AuthService {
message
GetAuthStatusRequest
{}
message
GetAuthStatusRequest
{}
message
GetAuthStatusResponse
{
message
GetAuthStatusResponse
{
bool
ok
=
1
;
User
user
=
1
;
}
}
proto/gen/api/v2/README.md
View file @
fff42ebc
This diff is collapsed.
Click to expand it.
proto/gen/api/v2/auth_service.pb.go
View file @
fff42ebc
...
@@ -64,7 +64,7 @@ type GetAuthStatusResponse struct {
...
@@ -64,7 +64,7 @@ type GetAuthStatusResponse struct {
sizeCache
protoimpl
.
SizeCache
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
unknownFields
protoimpl
.
UnknownFields
Ok
bool
`protobuf:"varint,1,opt,name=ok,proto3" json:"ok
,omitempty"`
User
*
User
`protobuf:"bytes,1,opt,name=user,proto3" json:"user
,omitempty"`
}
}
func
(
x
*
GetAuthStatusResponse
)
Reset
()
{
func
(
x
*
GetAuthStatusResponse
)
Reset
()
{
...
@@ -99,11 +99,11 @@ func (*GetAuthStatusResponse) Descriptor() ([]byte, []int) {
...
@@ -99,11 +99,11 @@ func (*GetAuthStatusResponse) Descriptor() ([]byte, []int) {
return
file_api_v2_auth_service_proto_rawDescGZIP
(),
[]
int
{
1
}
return
file_api_v2_auth_service_proto_rawDescGZIP
(),
[]
int
{
1
}
}
}
func
(
x
*
GetAuthStatusResponse
)
Get
Ok
()
bool
{
func
(
x
*
GetAuthStatusResponse
)
Get
User
()
*
User
{
if
x
!=
nil
{
if
x
!=
nil
{
return
x
.
Ok
return
x
.
User
}
}
return
false
return
nil
}
}
var
File_api_v2_auth_service_proto
protoreflect
.
FileDescriptor
var
File_api_v2_auth_service_proto
protoreflect
.
FileDescriptor
...
@@ -111,33 +111,36 @@ var File_api_v2_auth_service_proto protoreflect.FileDescriptor
...
@@ -111,33 +111,36 @@ var File_api_v2_auth_service_proto protoreflect.FileDescriptor
var
file_api_v2_auth_service_proto_rawDesc
=
[]
byte
{
var
file_api_v2_auth_service_proto_rawDesc
=
[]
byte
{
0x0a
,
0x19
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x61
,
0x75
,
0x74
,
0x68
,
0x5f
,
0x73
,
0x65
,
0x0a
,
0x19
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x61
,
0x75
,
0x74
,
0x68
,
0x5f
,
0x73
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x12
,
0x0c
,
0x6d
,
0x65
,
0x6d
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x12
,
0x0c
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x1a
,
0x1c
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x1a
,
0x19
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x65
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x61
,
0x6e
,
0x6e
,
0x6f
,
0x74
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x32
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x72
,
0x5f
,
0x73
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x2e
,
0x70
,
0x73
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x22
,
0x16
,
0x0a
,
0x14
,
0x47
,
0x65
,
0x74
,
0x41
,
0x75
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x1a
,
0x1c
,
0x67
,
0x6f
,
0x6f
,
0x67
,
0x6c
,
0x65
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x22
,
0x2f
,
0x61
,
0x6e
,
0x6e
,
0x6f
,
0x74
,
0x61
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x73
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x27
,
0x0a
,
0x15
,
0x47
,
0x65
,
0x74
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x74
,
0x6f
,
0x22
,
0x16
,
0x0a
,
0x14
,
0x47
,
0x65
,
0x74
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x0e
,
0x0a
,
0x02
,
0x6f
,
0x6b
,
0x18
,
0x01
,
0x74
,
0x75
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x22
,
0x3f
,
0x0a
,
0x15
,
0x47
,
0x65
,
0x20
,
0x01
,
0x28
,
0x08
,
0x52
,
0x02
,
0x6f
,
0x6b
,
0x32
,
0x84
,
0x01
,
0x0a
,
0x0b
,
0x41
,
0x75
,
0x74
,
0x74
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x68
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x12
,
0x75
,
0x0a
,
0x0d
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6e
,
0x73
,
0x65
,
0x12
,
0x26
,
0x0a
,
0x04
,
0x75
,
0x73
,
0x65
,
0x72
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x12
,
0x22
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x0b
,
0x32
,
0x12
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x41
,
0x75
,
0x74
,
0x68
,
0x2e
,
0x55
,
0x73
,
0x65
,
0x72
,
0x52
,
0x04
,
0x75
,
0x73
,
0x65
,
0x72
,
0x32
,
0x84
,
0x01
,
0x0a
,
0x0b
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x23
,
0x2e
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x12
,
0x75
,
0x0a
,
0x0d
,
0x47
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x65
,
0x74
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x12
,
0x22
,
0x2e
,
0x6d
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x52
,
0x65
,
0x73
,
0x70
,
0x6f
,
0x6e
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x41
,
0x73
,
0x65
,
0x22
,
0x1b
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x15
,
0x22
,
0x13
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x61
,
0x75
,
0x74
,
0x68
,
0x2f
,
0x73
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x42
,
0x1a
,
0x23
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0xa8
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x47
,
0x65
,
0x74
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x52
,
0x65
,
0x73
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x42
,
0x10
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x70
,
0x6f
,
0x6e
,
0x73
,
0x65
,
0x22
,
0x1b
,
0x82
,
0xd3
,
0xe4
,
0x93
,
0x02
,
0x15
,
0x22
,
0x13
,
0x2f
,
0x65
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x30
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x61
,
0x75
,
0x74
,
0x68
,
0x2f
,
0x73
,
0x74
,
0x61
,
0x74
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x75
,
0x73
,
0x42
,
0xa8
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x61
,
0x70
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x42
,
0x10
,
0x41
,
0x75
,
0x74
,
0x68
,
0x53
,
0x65
,
0x72
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x3b
,
0x61
,
0x70
,
0x69
,
0x76
,
0x32
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x41
,
0x58
,
0x76
,
0x69
,
0x63
,
0x65
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x30
,
0x67
,
0x69
,
0x74
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x41
,
0x70
,
0x69
,
0x2e
,
0x56
,
0x32
,
0xca
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0xe2
,
0x02
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0x5c
,
0x47
,
0x50
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x3b
,
0x61
,
0x70
,
0x69
,
0x76
,
0x32
,
0xa2
,
0x02
,
0x03
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0e
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x4d
,
0x41
,
0x58
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x41
,
0x70
,
0x69
,
0x2e
,
0x73
,
0x3a
,
0x3a
,
0x41
,
0x70
,
0x69
,
0x3a
,
0x3a
,
0x56
,
0x32
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x56
,
0x32
,
0xca
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x6f
,
0x33
,
0x32
,
0xe2
,
0x02
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0e
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x41
,
0x70
,
0x69
,
0x3a
,
0x3a
,
0x56
,
0x32
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
}
var
(
var
(
...
@@ -156,15 +159,17 @@ var file_api_v2_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
...
@@ -156,15 +159,17 @@ var file_api_v2_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var
file_api_v2_auth_service_proto_goTypes
=
[]
interface
{}{
var
file_api_v2_auth_service_proto_goTypes
=
[]
interface
{}{
(
*
GetAuthStatusRequest
)(
nil
),
// 0: memos.api.v2.GetAuthStatusRequest
(
*
GetAuthStatusRequest
)(
nil
),
// 0: memos.api.v2.GetAuthStatusRequest
(
*
GetAuthStatusResponse
)(
nil
),
// 1: memos.api.v2.GetAuthStatusResponse
(
*
GetAuthStatusResponse
)(
nil
),
// 1: memos.api.v2.GetAuthStatusResponse
(
*
User
)(
nil
),
// 2: memos.api.v2.User
}
}
var
file_api_v2_auth_service_proto_depIdxs
=
[]
int32
{
var
file_api_v2_auth_service_proto_depIdxs
=
[]
int32
{
0
,
// 0: memos.api.v2.AuthService.GetAuthStatus:input_type -> memos.api.v2.GetAuthStatusRequest
2
,
// 0: memos.api.v2.GetAuthStatusResponse.user:type_name -> memos.api.v2.User
1
,
// 1: memos.api.v2.AuthService.GetAuthStatus:output_type -> memos.api.v2.GetAuthStatusResponse
0
,
// 1: memos.api.v2.AuthService.GetAuthStatus:input_type -> memos.api.v2.GetAuthStatusRequest
1
,
// [1:2] is the sub-list for method output_type
1
,
// 2: memos.api.v2.AuthService.GetAuthStatus:output_type -> memos.api.v2.GetAuthStatusResponse
0
,
// [0:1] is the sub-list for method input_type
2
,
// [2:3] is the sub-list for method output_type
0
,
// [0:0] is the sub-list for extension type_name
1
,
// [1:2] is the sub-list for method input_type
0
,
// [0:0] is the sub-list for extension extendee
1
,
// [1:1] is the sub-list for extension type_name
0
,
// [0:0] is the sub-list for field type_name
1
,
// [1:1] is the sub-list for extension extendee
0
,
// [0:1] is the sub-list for field type_name
}
}
func
init
()
{
file_api_v2_auth_service_proto_init
()
}
func
init
()
{
file_api_v2_auth_service_proto_init
()
}
...
@@ -172,6 +177,7 @@ func file_api_v2_auth_service_proto_init() {
...
@@ -172,6 +177,7 @@ func file_api_v2_auth_service_proto_init() {
if
File_api_v2_auth_service_proto
!=
nil
{
if
File_api_v2_auth_service_proto
!=
nil
{
return
return
}
}
file_api_v2_user_service_proto_init
()
if
!
protoimpl
.
UnsafeEnabled
{
if
!
protoimpl
.
UnsafeEnabled
{
file_api_v2_auth_service_proto_msgTypes
[
0
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
file_api_v2_auth_service_proto_msgTypes
[
0
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
GetAuthStatusRequest
);
i
{
switch
v
:=
v
.
(
*
GetAuthStatusRequest
);
i
{
...
...
web/src/store/module/user.ts
View file @
fff42ebc
...
@@ -78,16 +78,16 @@ const doSignOut = async () => {
...
@@ -78,16 +78,16 @@ const doSignOut = async () => {
const
fetchCurrentUser
=
async
()
=>
{
const
fetchCurrentUser
=
async
()
=>
{
const
userId
=
localStorage
.
getItem
(
"userId"
);
const
userId
=
localStorage
.
getItem
(
"userId"
);
if
(
userId
)
{
if
(
userId
)
{
const
{
ok
}
=
await
authServiceClient
.
getAuthStatus
({});
const
{
user
}
=
await
authServiceClient
.
getAuthStatus
({});
if
(
!
ok
)
{
if
(
!
user
)
{
localStorage
.
removeItem
(
"userId"
);
localStorage
.
removeItem
(
"userId"
);
return
;
return
;
}
}
const
{
data
}
=
await
api
.
getUserById
(
Number
(
userId
));
const
{
data
}
=
await
api
.
getUserById
(
Number
(
userId
));
const
user
=
convertResponseModelUser
(
data
);
const
user
Message
=
convertResponseModelUser
(
data
);
if
(
user
)
{
if
(
user
Message
)
{
store
.
dispatch
(
setUser
(
user
));
store
.
dispatch
(
setUser
(
user
Message
));
return
user
;
return
user
Message
;
}
}
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment