mirror of
https://github.com/Dvorinka/excalidraw-full.git
synced 2026-06-03 22:02:57 +00:00
feat: full project sync - CI fixes, frontend, workspace API, and all changes
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package workspace
|
||||
|
||||
import "context"
|
||||
|
||||
type currentSession struct {
|
||||
user *User
|
||||
session *Session
|
||||
}
|
||||
|
||||
func withUser(ctx context.Context, user *User, session *Session) context.Context {
|
||||
return context.WithValue(ctx, currentUserKey, currentSession{user: user, session: session})
|
||||
}
|
||||
|
||||
func currentUser(r interface{ Context() context.Context }) (*User, *Session) {
|
||||
current, _ := r.Context().Value(currentUserKey).(currentSession)
|
||||
return current.user, current.session
|
||||
}
|
||||
Reference in New Issue
Block a user