Back to Skills

user-module

verified

myfy UserModule for authentication with email/password, OAuth, sessions, and JWT. Use when working with UserModule, BaseUser, OAuth providers, login, registration, password reset, email verification, or user authentication.

View on GitHub

Marketplace

myfy-plugins

psincraian/myfy

Plugin

myfy

frameworks

Repository

psincraian/myfy
83stars

plugins/claude-code/skills/user-module/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/psincraian/myfy/blob/main/plugins/claude-code/skills/user-module/SKILL.md -a claude-code --skill user-module

Installation paths:

Claude
.claude/skills/user-module/
Powered by add-skill CLI

Instructions

# UserModule - User Authentication

UserModule provides complete user authentication with email/password, OAuth, sessions, and JWT tokens.

## Quick Start

```python
from myfy.core import Application
from myfy.data import DataModule
from myfy.web import WebModule
from myfy.web.auth import AuthModule
from myfy.user import UserModule, BaseUser
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy import String

# Extend BaseUser with custom fields
class User(BaseUser):
    __tablename__ = "users"
    phone: Mapped[str | None] = mapped_column(String(20))

# Create module
user_module = UserModule(
    user_model=User,
    oauth_providers=["google", "github"],
    auto_create_tables=True,
)

# Set up application
app = Application()
app.add_module(DataModule())
app.add_module(WebModule())
app.add_module(AuthModule(
    authenticated_provider=user_module.get_authenticated_provider(),
))
app.add_module(user_module)
```

## Configuration

Environment variables use the `MYFY_USER_` prefix:

| Variable | Default | Description |
|----------|---------|-------------|
| `MYFY_USER_SECRET_KEY` | (auto-generated) | Secret for JWT/sessions |
| `MYFY_USER_SESSION_LIFETIME` | `604800` | Session duration (7 days, in seconds) |
| `MYFY_USER_JWT_ALGORITHM` | `HS256` | JWT signing algorithm |
| `MYFY_USER_JWT_ACCESS_TOKEN_LIFETIME` | `3600` | JWT access token lifetime |
| `MYFY_USER_PASSWORD_MIN_LENGTH` | `8` | Minimum password length |
| `MYFY_USER_REQUIRE_EMAIL_VERIFICATION` | `True` | Require email verification |

### OAuth Configuration

```bash
# Google OAuth
MYFY_USER_OAUTH_GOOGLE_CLIENT_ID=your-client-id
MYFY_USER_OAUTH_GOOGLE_CLIENT_SECRET=your-secret

# GitHub OAuth
MYFY_USER_OAUTH_GITHUB_CLIENT_ID=your-client-id
MYFY_USER_OAUTH_GITHUB_CLIENT_SECRET=your-secret
```

## Module Options

```python
UserModule(
    user_model=User,              # Custom user model (must extend BaseUser)
    oauth_providers=["google"],   # OAuth providers to enable
    auto_create_tables=True

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6506 chars