Bedtimestory9
So I’m working on a spending tracker app, and I want everyone gets to use the app without logging in as a user first. I also want the non-user to be able to save the data that only belongs to their device (using uuid or similar identifier), but how do I create a session based on this? Or do I need a session implementation at all?
Just in general, how do people approach non-user usage for their phone app?
I’ve been thinking and adding schema/functions for this problem for 2 days, really need your helps. Thanks!
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 4- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
codeanpeace
I’ve needed something similar in the past for an in person multiplayer game so that friends invited via a QR code could join and start playing immediately without signing up, but could create an account after the game ends to save the game data e.g. result, chat, stats, etc.
Given the low stakes and to keep things simple, I’d create and log each guest players into a new placeholder user account marked as a guest account and tied to the client’s session uuid when they scanned a QR that opened a url to join a specific active game e.g.
myapp.com/join/[game-uuid].That way retroactively creating an account meant adding some auth method whiling removing the guest account flag and vestigial session uuid. That guest flag also makes it simple for a cron job to delete unconverted guest accounts older than some threshold. In theory, you could use the presence of a session uuid to indicate a guest account… ¯\_(ツ)_/¯
Bedtimestory9
Your solution seems pretty good to me, but how do you verify that guest player is that particular guest? Or verify a session? I’m pretty new to Auth and have no knowledge on this, can you give me some pointers on how to manage this session?
rhcarvalho
You can look at the code generated by
phx.gen.auth, lots of lessons to learn there. The generator is getting a big revamp on the upcoming Phoenix v1.8 release, focusing on magic-link authentication (worth looking at the newer code).You could use the same or similar token-issuing and session management code. When a new user shows up you generate a session token, optionally an automatic guest user.
Having a guest user might makes things easier if you need to save state associated with a
user_id. If you can / intend to save all temporary data on the session (cookie), then you could probably do without a user entity until they decide to create an account and then you can import the data from the session into the DB.Bedtimestory9
I’ll use a guest user, it seems cleaner and no need to use cookie. And thanks for the pointers.