Vibe Habit
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # [US-1.2] User can sign up / login bằng email và password ## Description ### Phương thức sign up / login với email và password Tính năng này cho phép người dùng đăng ký và đăng nhập vào hệ thống VibeHabit bằng email và password của họ. Đây là phương thức xác thực truyền thống, bổ sung cho các phương thức đăng nhập qua mạng xã hội và ẩn danh đã có trước đó. Phương thức này giúp người dùng có thể sử dụng ứng dụng mà không cần liên kết với tài khoản mạng xã hội, đồng thời vẫn đảm bảo dữ liệu của họ được lưu trữ an toàn trên đám mây và có thể truy cập từ nhiều thiết bị khác nhau. #### Login session - Phiên đăng nhập của người dùng sẽ tồn tại trong 90 ngày - Sau 90 ngày không hoạt động, người dùng sẽ được yêu cầu đăng nhập lại - Người dùng có thể chọn "Ghi nhớ đăng nhập" để kéo dài thời gian phiên đăng nhập #### User info Sau khi đăng ký/đăng nhập thành công bằng email và password, người dùng sẽ có thông tin sau trên app: - Email: được sử dụng làm định danh chính của tài khoản - Username: tên hiển thị trong ứng dụng - Avatar: ảnh đại diện mặc định được gán cho tài khoản mới, người dùng có thể thay đổi sau #### Xác thực email - Khi đăng ký tài khoản mới, hệ thống sẽ gửi email xác thực đến địa chỉ email người dùng đã đăng ký - Người dùng cần xác thực email trước khi có thể sử dụng đầy đủ các tính năng của ứng dụng - Nếu người dùng chưa xác thực email, họ vẫn có thể đăng nhập nhưng sẽ được nhắc nhở xác thực email ## Requirements | Task | Input | Output | | :---- | :---- | :---- | | Đăng ký tài khoản | Email, password, xác nhận password, username | Tài khoản mới, email xác thực | | Xác thực email | Mã xác thực từ email | Trạng thái xác thực email | | Đăng nhập | Email, password, (tùy chọn) ghi nhớ đăng nhập | Phiên đăng nhập, thông tin người dùng | | Gửi lại email xác thực | Email | Email xác thực mới | | Đăng xuất | N/A | Kết thúc phiên đăng nhập | ## Fields | Field | Description | Field type | Validation | | :---- | :---- | :---- | :---- | | email | Địa chỉ email dùng để đăng ký tài khoản | String | Bắt buộc, định dạng email hợp lệ, độ dài tối đa 255 ký tự, không trùng với email đã tồn tại | | password | Mật khẩu của tài khoản | String | Bắt buộc, tối thiểu 8 ký tự, bao gồm ít nhất 1 chữ hoa, 1 chữ thường, 1 số | | confirm_password | Xác nhận mật khẩu | String | Bắt buộc, phải trùng khớp với password | | username | Tên hiển thị của người dùng trong ứng dụng | String | Bắt buộc, 3-30 ký tự, chỉ cho phép chữ cái, số, và dấu cách | | email_verified | Trạng thái xác thực email | Boolean | Mặc định: false | | verification_token | Mã token dùng để xác thực email | String | Tự động tạo, 64 ký tự | | verification_token_expiry | Thời gian hết hạn của token xác thực | Timestamp | 24 giờ kể từ khi tạo | | remember_login | Lựa chọn ghi nhớ đăng nhập | Boolean | Mặc định: false | | created_at | Thời gian tạo tài khoản | Timestamp | Tự động tạo | | last_login_at | Thời gian đăng nhập gần nhất | Timestamp | Tự động cập nhật khi đăng nhập | | last_login_ip | Địa chỉ IP đăng nhập gần nhất | String | Tự động ghi lại | | avatar | Ảnh đại diện của người dùng | URL | Mặc định: URL ảnh đại diện mặc định | ## Mockup [Giao diện Đăng ký/Đăng nhập Email](https://www.figma.com/file/email-auth-wireframes) ## Scenarios ### Acceptance Criteria 1: Đăng ký tài khoản mới thành công **Given that:** - Người dùng chưa có tài khoản - Người dùng đang ở màn hình đăng ký **When:** - Người dùng nhập email chưa được sử dụng - Người dùng nhập mật khẩu đáp ứng yêu cầu bảo mật - Người dùng xác nhận lại mật khẩu trùng khớp - Người dùng nhập username - Người dùng nhấn nút "Đăng ký" **Then:** - Hệ thống tạo tài khoản mới - Hệ thống gửi email xác thực đến địa chỉ email đã đăng ký - Hệ thống hiển thị thông báo thành công và hướng dẫn kiểm tra email - Người dùng được chuyển đến màn hình đăng nhập ### Acceptance Criteria 2: Xác thực email thành công **Given that:** - Người dùng đã đăng ký tài khoản - Người dùng chưa xác thực email - Email xác thực đã được gửi đến địa chỉ email người dùng **When:** - Người dùng mở email xác thực - Người dùng nhấp vào liên kết xác thực trong email **Then:** - Hệ thống xác thực email thành công - Trạng thái email_verified được cập nhật thành true - Người dùng được chuyển đến màn hình xác nhận thành công - Người dùng có thể sử dụng đầy đủ các tính năng của ứng dụng ### Acceptance Criteria 3: Đăng nhập thành công **Given that:** - Người dùng đã có tài khoản - Người dùng đang ở màn hình đăng nhập **When:** - Người dùng nhập email chính xác - Người dùng nhập mật khẩu chính xác - Người dùng nhấn nút "Đăng nhập" **Then:** - Hệ thống xác thực thông tin đăng nhập - Hệ thống tạo phiên đăng nhập mới - Người dùng được chuyển đến màn hình chính của ứng dụng ### Acceptance Criteria 4: Nhắc nhở xác thực email **Given that:** - Người dùng đã đăng nhập - Người dùng chưa xác thực email **When:** - Người dùng sử dụng ứng dụng **Then:** - Hệ thống hiển thị banner nhắc nhở xác thực email - Banner chứa nút "Gửi lại email xác thực" - Khi người dùng nhấn nút, hệ thống gửi email xác thực mới ### Acceptance Criteria 5: Đăng nhập với tùy chọn "Ghi nhớ đăng nhập" **Given that:** - Người dùng đã có tài khoản - Người dùng đang ở màn hình đăng nhập **When:** - Người dùng nhập thông tin đăng nhập chính xác - Người dùng chọn tùy chọn "Ghi nhớ đăng nhập" - Người dùng nhấn nút "Đăng nhập" **Then:** - Hệ thống tạo phiên đăng nhập kéo dài - Người dùng không cần đăng nhập lại trong 90 ngày - Thông tin đăng nhập được lưu trữ an toàn trên thiết bị ### Acceptance Criteria 6: Thông báo lỗi khi đăng ký **Given that:** - Người dùng đang ở màn hình đăng ký **When:** - Người dùng nhập email đã được sử dụng - Người dùng nhập mật khẩu không đáp ứng yêu cầu bảo mật - Người dùng nhập xác nhận mật khẩu không trùng khớp - Người dùng nhập username không hợp lệ - Người dùng nhấn nút "Đăng ký" **Then:** - Hệ thống hiển thị thông báo lỗi cụ thể cho từng trường hợp: - "Email đã được sử dụng" - "Mật khẩu phải có ít nhất 8 ký tự, bao gồm chữ hoa, chữ thường và số" - "Xác nhận mật khẩu không trùng khớp" - "Username chỉ được chứa chữ cái, số và dấu cách" - Hệ thống không tạo tài khoản mới - Người dùng vẫn ở màn hình đăng ký ### Acceptance Criteria 7: Thông báo lỗi khi đăng nhập **Given that:** - Người dùng đang ở màn hình đăng nhập **When:** - Người dùng nhập email không tồn tại - HOẶC người dùng nhập mật khẩu không chính xác - Người dùng nhấn nút "Đăng nhập" **Then:** - Hệ thống hiển thị thông báo lỗi chung "Email hoặc mật khẩu không chính xác" - Người dùng không được đăng nhập - Người dùng vẫn ở màn hình đăng nhập ### Acceptance Criteria 8: Đăng xuất **Given that:** - Người dùng đã đăng nhập **When:** - Người dùng chọn tùy chọn "Đăng xuất" từ menu **Then:** - Phiên đăng nhập hiện tại kết thúc - Nếu người dùng đã chọn "Ghi nhớ đăng nhập", tùy chọn này bị vô hiệu hóa - Người dùng được chuyển hướng về màn hình đăng nhập

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully