Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass/disable email verification #569

Open
gimzmoe opened this issue May 20, 2022 · 7 comments
Open

Bypass/disable email verification #569

gimzmoe opened this issue May 20, 2022 · 7 comments

Comments

@gimzmoe
Copy link

gimzmoe commented May 20, 2022

Motivation / Use Case
I find using any online version to be laggy unenjoyable, I'd like to run a stand-alone in VM but the email verification adds complexity in the setup that is undesirable

Expected Behavior

Bypass/disable email verification for account creation

Other Information

Perhaps this is possible already? are there instructions on how one can inject an authorized user?

@denis-dysen
Copy link

Did you ever find a solution to this? I don't want to set up an smtp relay just for this container

@SqueeG
Copy link

SqueeG commented Feb 10, 2023

This is dependent on whether you can access the repl in your VM

If you can, then it's possible to send commands to your DB, yes

@denis-dysen
Copy link

I have full access to the underlying files and database, but I am struggling to edit the database. Do you know how I could simply edit it to believe my user is verified?

@datdamnzotz
Copy link

You have to have a repl connection to the db, and do something like this
https://github.com/Orcpub/orcpub/blob/develop/dev/user.clj#L96C7-L96C13

@denis-dysen
Copy link

If someone would be so kind, could you explain how to do this? I have orcpub running in a docker-compose stack

@codeGlaze
Copy link

codeGlaze commented Oct 10, 2023

If I remember correctly getting a proper replacement connection through docker is a nightmare... If you're able to, it's much easier to run the project bare on a PC so you can interact directly with it. You'll need JRE8 and use our copy of the "free" (discontinued) datomic because new versions don't run on windows; via a bug they haven't bothered to fix.

We really should move the docker instructions from the top of the README.

Or finagle an admin panel in to just boop these problems away

@Kholtien
Copy link

Kholtien commented Mar 12, 2025

FYI: This is what worked for me to manually verify a user. (I can't get the email to work for some reason)

Complete Instructions for Verifying a User in Datomic

1. Connect to Datomic Container

# Connect to the Datomic container bash shell
docker exec -it <container_name> bash

# If you don't know the container name, find it with
docker ps

2. Start the REPL

# Navigate to the application directory if needed
cd /path/to/app

# Start the Clojure REPL
./bin/repl

3. Connect to Datomic and Verify the User

Once the REPL is running, enter these commands:

;; Import the Datomic API
(require '[datomic.api :as d])

;; Connect to the database
(def conn (d/connect "datomic:free://datomic:4334/orcpub?password=[password]"))

;; Get the current database value
(def db (d/db conn))

;; Define a function to verify a user
(defn manual-verify-user [email-or-username]
  (let [user-eid (ffirst (d/q '[:find ?e
                               :in $ ?email-or-username
                               :where
                               (or [?e :orcpub.user/email ?email-or-username]
                                   [?e :orcpub.user/username ?email-or-username])]
                             db email-or-username))]
    (if user-eid
      (let [verification-key (d/q '[:find ?key .
                                  :in $ ?e
                                  :where [?e :orcpub.user/verification-key ?key]]
                                db user-eid)]
        (if verification-key
          (do
            (println "Found verification key:" verification-key)
            (d/transact conn [{:db/id user-eid
                              :orcpub.user/verified? true}]))  
          (println "No verification key found for user")))
      (println "User not found"))))

;; Verify a user by providing their email or username
(manual-verify-user "[email protected]")

;; Optionally, verify the change was applied
(d/q '[:find ?verified .
      :in $ ?email
      :where
      [?e :orcpub.user/email ?email]
      [?e :orcpub.user/verified? ?verified]]
    (d/db conn) "[email protected]")

4. Exit the REPL

When you're done, exit the REPL:

;; Press Ctrl+D or type:
:quit

Then exit the container shell:

exit

These instructions should work whenever you need to manually verify a user in your Datomic database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants