mirror of
https://git.sr.ht/~sircmpwn/tokidoki
synced 2025-12-12 06:07:22 +01:00
Use base64 encoded user name as their base dir
This is safe in all circumstance and leaves it up to the auth backend to use whatever name they like for authentication.
This commit is contained in:
parent
04be038c05
commit
07c19a6f6c
1 changed files with 2 additions and 2 deletions
|
|
@ -45,8 +45,8 @@ func (b *filesystemBackend) pathForContext(ctx context.Context) (string, error)
|
|||
if !ok {
|
||||
panic("Invalid data in auth context!")
|
||||
}
|
||||
//TODO sanitize user name or at least check if valid dir name?
|
||||
path := filepath.Join(b.path, authCtx.UserName)
|
||||
userDir := base64.RawStdEncoding.EncodeToString([]byte(authCtx.UserName))
|
||||
path := filepath.Join(b.path, userDir)
|
||||
|
||||
_, err := os.Stat(path)
|
||||
if os.IsNotExist(err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue